Commit a70d39b7 authored by Aryan Noshirvani's avatar Aryan Noshirvani

Fix import paths and service unit for relocated telegram_bot

The previous commit moved bot.py/ai_remix.py into src/telegram_bot/ but
missed staging the import-path fixes inside them, and the ExecStart in
stax_bot.service still pointed at the pre-reorg antigrav-stax-audio
path. Both were edited in the working tree already; this just gets them
into the commit.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BCxXmJVvDFJVHTUi4QgNzi
parent a16bc19c
Pipeline #986 passed with stages
in 4 minutes
...@@ -4,14 +4,14 @@ After=network.target ...@@ -4,14 +4,14 @@ After=network.target
[Service] [Service]
User=root User=root
WorkingDirectory=/root/antigrav-stax-audio WorkingDirectory=/root/stax_backend_api
Environment="PATH=/root/antigrav-stax-audio/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" Environment="PATH=/root/stax_backend_api/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Environment="PYTHONPATH=/root/antigrav-stax-audio" Environment="PYTHONPATH=/root/stax_backend_api"
ExecStart=/root/antigrav-stax-audio/venv/bin/python src/telegram_worker/telegram_client.py ExecStart=/root/stax_backend_api/venv/bin/python -m src.telegram_bot.bot
Restart=always Restart=always
RestartSec=5 RestartSec=5
StandardOutput=append:/root/antigrav-stax-audio/bot.log StandardOutput=append:/root/stax_backend_api/bot.log
StandardError=append:/root/antigrav-stax-audio/bot.log StandardError=append:/root/stax_backend_api/bot.log
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
...@@ -6,11 +6,11 @@ from telegram.ext import ( ...@@ -6,11 +6,11 @@ from telegram.ext import (
filters, ContextTypes, ConversationHandler filters, ContextTypes, ConversationHandler
) )
from config import TELEGRAM_BOT_TOKEN, LALAL_API_KEY, logger from src.core.config import TELEGRAM_BOT_TOKEN, LALAL_API_KEY, logger
from database import init_db, log_correction from src.core.database import init_db, log_correction
from music_identification import identify_audio, fetch_lyrics from src.services.music_identification import identify_audio, fetch_lyrics
from audio_processing import tag_and_convert_audio from src.services.audio_processing import tag_and_convert_audio
from ai_remix import get_remix_recipe, apply_remix from src.telegram_bot.ai_remix import get_remix_recipe, apply_remix
async def update_progress(status_msg, cancel_event, remix_name): async def update_progress(status_msg, cancel_event, remix_name):
for i in range(1, 100): for i in range(1, 100):
...@@ -215,7 +215,7 @@ async def handle_lang_pref(update: Update, context: ContextTypes.DEFAULT_TYPE) - ...@@ -215,7 +215,7 @@ async def handle_lang_pref(update: Update, context: ContextTypes.DEFAULT_TYPE) -
lang_pref = "native" if query.data == "lang_native" else "finglish" lang_pref = "native" if query.data == "lang_native" else "finglish"
await query.edit_message_text("🎧 Uploading audio to Gemini and analyzing... (This takes a few seconds)") await query.edit_message_text("🎧 Uploading audio to Gemini and analyzing... (This takes a few seconds)")
from music_identification import identify_with_gemini from src.services.music_identification import identify_with_gemini
gemini_candidate = await identify_with_gemini(context.user_data['raw_file_path'], lang_pref) gemini_candidate = await identify_with_gemini(context.user_data['raw_file_path'], lang_pref)
if not gemini_candidate: if not gemini_candidate:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment