File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1414from config import get_config
1515from services .background_tasks import init_background_tasks
1616from services .database import init_database
17+ from services .path_utils import expand_path
1718
1819from routes .stream import router as stream_router , init_stream_globals
1920from routes .queue import router as queue_router
@@ -83,14 +84,14 @@ def filter(self, record: logging.LogRecord) -> bool:
8384init_database ()
8485
8586# Audio download directory is always needed
86- os . makedirs (config .temp_audio_dir , exist_ok = True )
87+ expand_path (config .temp_audio_dir ). mkdir ( parents = True , exist_ok = True )
8788
8889# Create TTS audio directory if TTS is enabled
8990if config .tts_enabled :
9091 logger .info (
9192 f"TTS enabled - creating audio directory: { config .weekly_summary_audio_dir } "
9293 )
93- os . makedirs (config .weekly_summary_audio_dir , exist_ok = True )
94+ expand_path (config .weekly_summary_audio_dir ). mkdir ( parents = True , exist_ok = True )
9495
9596# Initialize background tasks if transcription is enabled
9697if config .transcription_enabled :
Original file line number Diff line number Diff line change 99import subprocess
1010
1111from services .cache import get_audio_cache
12- from services .path_utils import expand_path
12+ from services .path_utils import expand_path , expand_path_str
1313from config import get_config
1414
1515logger = logging .getLogger (__name__ )
@@ -63,7 +63,7 @@ def start_youtube_download(youtube_video_id: str):
6363 # -o uses the base path WITHOUT extension — yt-dlp appends .mp3 via --audio-format.
6464 # Passing -o with .mp3 extension causes yt-dlp to create path.mp3.mp3.
6565 # --extract-audio handles the ffmpeg conversion internally.
66- base_path = os .path .join (config .temp_audio_dir , youtube_video_id )
66+ base_path = expand_path_str ( os .path .join (config .temp_audio_dir , youtube_video_id ) )
6767 yt_cmd = [
6868 "/usr/local/bin/yt-dlp" ,
6969 "-f" ,
Original file line number Diff line number Diff line change 99from config import get_config
1010from services .database import get_video_title_from_history
1111from services .api_clients import get_httpx_client
12+ from services .path_utils import expand_path_str
1213
1314logger = logging .getLogger (__name__ )
1415
@@ -410,7 +411,7 @@ def attach_audio_to_note(
410411 logger .info (f"Created file note: { file_note_id } " )
411412
412413 # Step 2: Upload the file content using a direct HTTP client
413- with open (audio_file_path , "rb" ) as f :
414+ with open (expand_path_str ( audio_file_path ) , "rb" ) as f :
414415 audio_data = f .read ()
415416
416417 file_size_mb = len (audio_data ) / (1024 * 1024 )
You can’t perform that action at this time.
0 commit comments