완성
This commit is contained in:
1 parent
52520d770b
commit
3bfb5c81b6
4 files changed
+22
-8
No files matched your search
@@ -238,9 +238,10 @@ async def get_song_status(
|
||||
|
||||
# SUCCESS 상태인 경우 백그라운드 태스크 실행
|
||||
if parsed_response.status == "SUCCESS" and parsed_response.clips:
|
||||
# 첫 번째 클립의 audioUrl 가져오기
|
||||
# 첫 번째 클립의 audioUrl과 duration 가져오기
|
||||
first_clip = parsed_response.clips[0]
|
||||
audio_url = first_clip.audio_url
|
||||
clip_duration = first_clip.duration
|
||||
|
||||
if audio_url:
|
||||
# suno_task_id로 Song 조회하여 store_name 가져오기
|
||||
@@ -263,12 +264,13 @@ async def get_song_status(
|
||||
store_name = project.store_name if project else "song"
|
||||
|
||||
# 백그라운드 태스크로 MP3 다운로드 및 Blob 업로드, DB 업데이트 (suno_task_id 사용)
|
||||
print(f"[get_song_status] Background task args - suno_task_id: {suno_task_id}, audio_url: {audio_url}, store_name: {store_name}")
|
||||
print(f"[get_song_status] Background task args - suno_task_id: {suno_task_id}, audio_url: {audio_url}, store_name: {store_name}, duration: {clip_duration}")
|
||||
background_tasks.add_task(
|
||||
download_and_upload_song_by_suno_task_id,
|
||||
suno_task_id=suno_task_id,
|
||||
audio_url=audio_url,
|
||||
store_name=store_name,
|
||||
duration=clip_duration,
|
||||
)
|
||||
elif song and song.status == "completed":
|
||||
print(f"[get_song_status] SKIPPED - Song already completed, suno_task_id: {suno_task_id}")
|
||||
|
||||
Reference in new issue
Block a user