music-lab: 서비스 고도화 — duration 수정 + 모델/크레딧/연장/분리 API 추가

Phase 1A:
- mutagen으로 MP3 실제 재생시간 추출 (sync + startup backfill)
- update_track_duration() DB 헬퍼 추가

Phase 2:
- GET /api/music/models — Suno 모델 목록 (V4~V5)
- GET /api/music/credits — 잔여 크레딧 조회
- POST /api/music/extend — 곡 연장 (continueAt 지점부터)
- POST /api/music/vocal-removal — 보컬/인스트루멘탈 분리
- GenerateRequest에 model 필드 추가 (하드코딩 V4 제거)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 14:36:52 +09:00
parent 4b339d9d4f
commit 649b99d143
4 changed files with 281 additions and 4 deletions

View File

@@ -207,6 +207,14 @@ def get_track_by_task_id(task_id: str) -> Optional[Dict[str, Any]]:
return _track_row_to_dict(row) if row else None
def update_track_duration(track_id: int, duration_sec: int) -> None:
with _conn() as conn:
conn.execute(
"UPDATE music_library SET duration_sec = ? WHERE id = ? AND duration_sec IS NULL",
(duration_sec, track_id),
)
def get_track_file_path(track_id: int) -> Optional[str]:
with _conn() as conn:
row = conn.execute("SELECT file_path FROM music_library WHERE id = ?", (track_id,)).fetchone()