오늘의 응원가 자동 생성 파이프라인 (Suno)

- 경기 맥락(전날 결과·순위·연전 차수·선발투수) 조립 → LLM 작사
  (콜앤리스폰스·섹션 태그 형식) → Suno(sunoapi.org) 생성 → songs 테이블
- 워커: 킥오프 150분 전 윈도우 진입 시 생성 시작 + 2분 주기 폴링
- API: GET /api/songs/today · POST /api/songs/callback(싱크대)
  · POST /api/songs/generate(관리자 강제 생성)
- 프론트: MusicBar 가 경기 상세·메인에서 오늘의 응원가를 동적 로드
  (정적 플레이리스트는 폴백 유지)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
JinwooKimandClaude Fable 5 committed 2026-08-25 09:33:34 +09:00
1 parent 2a8f2bc1fa
commit 277378477a
11 files changed
+706 -7

No files matched your search

+7
View File
@@ -38,6 +38,7 @@ from .services.email import EmailUnavailable, build_result_email, send_email
from .services.grading import apply_result
from .services.schedule_fetch import fetch_results, fetch_schedule
from .services.schedule_sync import sync_schedule
from .services.songs import tick_songs
logging.basicConfig(level=logging.INFO)
log = logging.getLogger("triplepick.worker")
@@ -496,6 +497,12 @@ def build_scheduler() -> AsyncIOScheduler:
settle_baseball, "interval",
seconds=settings.settle_tick_seconds, id="baseball_settle",
)
# 오늘의 응원가: 킥오프 임박 경기 생성 시작 + Suno 작업 폴링
sched.add_job(
tick_songs, "interval",
seconds=settings.song_tick_seconds, id="songs",
next_run_time=now_utc(),
)
return sched