응원가 커버를 팀 로고 합성본으로 교체
- /api/songs/cover/:matchId/:teamCode — Suno 앨범아트(감광 배경) 위에 팀 로고 중앙 합성 (1200x630, OG 규격), 메모리 캐시 + task 캐시버스터 - 로고 소스: KBO=프론트 로컬 PNG(내부 프록시), MLB=mlbstatic spots PNG - 플레이어 썸네일·/song OG 카드 모두 합성 커버 사용, pillow 의존성 추가 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dbc26a4150
commit
434f282e6b
4 files changed
+118
-8
No files matched your search
@@ -73,11 +73,14 @@ async def song_share(
|
||||
)
|
||||
|
||||
origin = settings.public_origin.rstrip("/")
|
||||
# 썸네일: Suno 앨범아트(외부 CDN 절대 URL) → 없으면 기본 카드
|
||||
cover = ""
|
||||
# 썸네일: 합성 커버(Suno 아트 + 팀 로고, 1200x630) → 곡 없으면 기본 카드
|
||||
if s and s.tracks:
|
||||
cover = (s.tracks[0] or {}).get("imageUrl") or ""
|
||||
img_url = cover if cover.startswith("http") else f"{origin}{DEFAULT_OG}?v=2"
|
||||
img_url = (
|
||||
f"{origin}/api/songs/cover/{html.escape(match_id)}/"
|
||||
f"{html.escape(team_code)}?v={(s.task_id or '')[:8]}"
|
||||
)
|
||||
else:
|
||||
img_url = f"{origin}{DEFAULT_OG}?v=2"
|
||||
|
||||
page_url = f"{origin}/song/{html.escape(match_id)}/{html.escape(team_code)}"
|
||||
t = html.escape(title)
|
||||
|
||||
Reference in new issue
Block a user