duration 버그 픽스
parent
3bfb5c81b6
commit
5dddbaeda2
|
|
@ -238,10 +238,11 @@ async def get_song_status(
|
|||
|
||||
# SUCCESS 상태인 경우 백그라운드 태스크 실행
|
||||
if parsed_response.status == "SUCCESS" and parsed_response.clips:
|
||||
# 첫 번째 클립의 audioUrl과 duration 가져오기
|
||||
# 첫 번째 클립(clips[0])의 audioUrl과 duration 사용
|
||||
first_clip = parsed_response.clips[0]
|
||||
audio_url = first_clip.audio_url
|
||||
clip_duration = first_clip.duration
|
||||
print(f"[get_song_status] Using first clip - id: {first_clip.id}, audio_url: {audio_url}, duration: {clip_duration}")
|
||||
|
||||
if audio_url:
|
||||
# suno_task_id로 Song 조회하여 store_name 가져오기
|
||||
|
|
@ -273,6 +274,12 @@ async def get_song_status(
|
|||
duration=clip_duration,
|
||||
)
|
||||
elif song and song.status == "completed":
|
||||
# 이미 완료된 경우에도 duration이 다르면 업데이트
|
||||
if clip_duration is not None and song.duration != clip_duration:
|
||||
print(f"[get_song_status] Updating duration - suno_task_id: {suno_task_id}, old: {song.duration}, new: {clip_duration}")
|
||||
song.duration = clip_duration
|
||||
await session.commit()
|
||||
else:
|
||||
print(f"[get_song_status] SKIPPED - Song already completed, suno_task_id: {suno_task_id}")
|
||||
|
||||
print(f"[get_song_status] SUCCESS - suno_task_id: {suno_task_id}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue