fix(music-render): drop secondary webhook_add_track (T5 follow-up)
Code review found: f"{task_id}_v2" / "_inst" synthetic task IDs never
exist in NAS music_tasks table -> webhook returns 404 -> silent fail.
NAS music-lab/main.py._sync_library_with_disk() auto-registers any
.mp3 in the disk that has no DB row on next GET /api/music/library.
So Windows worker just writes the file to SMB; NAS picks it up on
the next library fetch -- matches NAS source behavior at file level.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -250,11 +250,9 @@ def run_suno_generation(task_id: str, params: dict) -> None:
|
||||
|
||||
if len(completed) > 1:
|
||||
try:
|
||||
second = _download_and_register(f"{task_id}_v2", completed[1], params)
|
||||
if second:
|
||||
# 두 번째 변형은 별도 task가 아니라 별도 track으로만 등록
|
||||
webhook_add_track(f"{task_id}_v2", "succeeded", 100, "두 번째 변형",
|
||||
audio_url=second["audio_url"], track=second)
|
||||
# 보조 변형은 SMB에 파일만 저장. NAS _sync_library_with_disk가 다음
|
||||
# GET /api/music/library 호출 시 자동으로 라이브러리에 등록.
|
||||
_download_and_register(f"{task_id}_v2", completed[1], params)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
@@ -348,10 +346,8 @@ def run_vocal_removal(task_id: str, params: dict) -> None:
|
||||
track = _download_and_register(task_id, completed[0], vp)
|
||||
if len(completed) > 1:
|
||||
ip = {**params, "title": f"{params.get('title', 'Track')} (Instrumental)"}
|
||||
second = _download_and_register(f"{task_id}_inst", completed[1], ip)
|
||||
if second:
|
||||
webhook_add_track(f"{task_id}_inst", "succeeded", 100, "Instrumental",
|
||||
audio_url=second["audio_url"], track=second)
|
||||
# Instrumental 변형은 SMB에 파일만 저장. NAS _sync_library_with_disk가 자동 등록.
|
||||
_download_and_register(f"{task_id}_inst", completed[1], ip)
|
||||
if track:
|
||||
webhook_add_track(task_id, "succeeded", 100, "보컬 분리 완료",
|
||||
audio_url=track["audio_url"], track=track)
|
||||
|
||||
Reference in New Issue
Block a user