This commit is contained in:
bluebamus committed 2025-12-26 17:50:46 +09:00
1 parent 52520d770b
commit 3bfb5c81b6
4 files changed
+22 -8

No files matched your search

+6 -2
View File
@@ -210,6 +210,7 @@ async def download_and_upload_song_by_suno_task_id(
suno_task_id: str,
audio_url: str,
store_name: str,
duration: float | None = None,
) -> None:
"""suno_task_id로 Song을 조회하여 노래를 다운로드하고 Azure Blob Storage에 업로드한 뒤 Song 테이블을 업데이트합니다.
@@ -217,8 +218,9 @@ async def download_and_upload_song_by_suno_task_id(
suno_task_id: Suno API 작업 ID
audio_url: 다운로드할 오디오 URL
store_name: 저장할 파일명에 사용할 업체명
duration: 노래 재생 시간 (초)
"""
print(f"[download_and_upload_song_by_suno_task_id] START - suno_task_id: {suno_task_id}, store_name: {store_name}")
print(f"[download_and_upload_song_by_suno_task_id] START - suno_task_id: {suno_task_id}, store_name: {store_name}, duration: {duration}")
temp_file_path: Path | None = None
task_id: str | None = None
@@ -287,8 +289,10 @@ async def download_and_upload_song_by_suno_task_id(
if song:
song.status = "completed"
song.song_result_url = blob_url
if duration is not None:
song.duration = duration
await session.commit()
print(f"[download_and_upload_song_by_suno_task_id] SUCCESS - suno_task_id: {suno_task_id}, status: completed")
print(f"[download_and_upload_song_by_suno_task_id] SUCCESS - suno_task_id: {suno_task_id}, status: completed, duration: {duration}")
else:
print(f"[download_and_upload_song_by_suno_task_id] Song NOT FOUND in DB - suno_task_id: {suno_task_id}")