diff --git a/backend/app/routers/share.py b/backend/app/routers/share.py index 3a48ba7..f6720ea 100644 --- a/backend/app/routers/share.py +++ b/backend/app/routers/share.py @@ -58,7 +58,10 @@ def _team_label(code: str | None) -> str: async def song_share( match_id: str, team_code: str, db: AsyncSession = Depends(get_db) ) -> HTMLResponse: - """응원가 공유 OG — '오늘의 OO 응원가' 제목 + Suno 앨범아트 썸네일.""" + """응원가 공유 OG — '8월 28일 OO 응원가' 제목 + Suno 앨범아트 썸네일. + + 제목의 날짜는 제작일(경기일 KST) — 매일 갱신되는 콘텐츠임을 드러낸다. + """ s = ( await db.execute( select(Song).where(Song.match_id == match_id, Song.team_code == team_code) @@ -66,9 +69,10 @@ async def song_share( ).scalar_one_or_none() team = (s.team_name if s else "") or _team_label(team_code) or team_code song_title = (s.title if s else "") or f"{team} 응원가" - title = f"오늘의 {team} 응원가 — {song_title}" + day = f"{s.date_kst.month}월 {s.date_kst.day}일" if s and s.date_kst else "오늘의" + title = f"{day} {team} 응원가 — {song_title}" desc = ( - "AI가 오늘 경기(순위·선발 라인업·전날 결과)를 반영해 만든 응원가. " + "AI가 경기 당일(순위·선발 라인업·전날 결과)을 반영해 매일 새로 만드는 응원가. " "듣고 나서 GPT·Claude·Gemini와 승부예측도 겨뤄보세요!" ) diff --git a/backend/app/routers/songs.py b/backend/app/routers/songs.py index 58d543f..b328572 100644 --- a/backend/app/routers/songs.py +++ b/backend/app/routers/songs.py @@ -40,6 +40,8 @@ def _song_out(s: Song) -> dict: "teamName": s.team_name, "title": s.title, "lyrics": s.lyrics, + # 제작일(경기일 KST) — 공유·플레이어 문구의 "8월 28일 OO 응원가" 표기용 + "dateKst": s.date_kst.isoformat() if s.date_kst else None, "tracks": tracks, } diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 33eab75..122b5e8 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -57,6 +57,8 @@ export interface SongOut { teamName: string; title: string; lyrics?: string; + /** 제작일(경기일 KST, YYYY-MM-DD) — "8월 28일 OO 응원가" 표기용 */ + dateKst?: string | null; tracks: SongTrackOut[]; } diff --git a/frontend/src/lib/playlist.ts b/frontend/src/lib/playlist.ts index 4f6f2de..b10e4b0 100644 --- a/frontend/src/lib/playlist.ts +++ b/frontend/src/lib/playlist.ts @@ -42,14 +42,18 @@ function fetchMatchSongsCached(matchId: string): Promise { function songToTracks(s: SongOut): Track[] { const base = s.title || `${s.teamName} 응원가`; - // 공유는 응원가 전용 링크 — 크롤러에 "오늘의 OO 응원가" OG 카드가 나간다 + // 제작일 표기 ("8월 28일") — 매일 갱신되는 콘텐츠임을 드러낸다. 날짜 없으면 "오늘의" + const day = s.dateKst + ? `${Number(s.dateKst.slice(5, 7))}월 ${Number(s.dateKst.slice(8, 10))}일` + : "오늘의"; + // 공유는 응원가 전용 링크 — 크롤러에 "8월 28일 OO 응원가" OG 카드가 나간다 const shareUrl = `${window.location.origin}/song/${s.matchId}/${s.teamCode}`; - const shareText = `오늘의 ${s.teamName} 응원가 「${base}」 — TriplePick`; + const shareText = `${day} ${s.teamName} 응원가 「${base}」 — TriplePick`; return (s.tracks || []) .filter((t) => t.audioUrl) .map((t, i) => ({ title: s.tracks.length > 1 ? `${base} #${i + 1}` : base, - artist: `오늘의 ${s.teamName} 응원가`, + artist: `${day} ${s.teamName} 응원가`, src: t.audioUrl, cover: t.imageUrl, lyrics: s.lyrics || undefined,