fix logo description

db-migration
jaehwang 2026-06-04 17:21:50 +09:00
parent 5baea01ae1
commit 4ad30d4d36
2 changed files with 19 additions and 6 deletions

View File

@ -47,17 +47,30 @@ async def _describe_channel_logos(analysis_run_id: str, info_id: int, vc: Vision
"""채널 프로필 로고를 공식 로고와 비교. branding raw_info["channelLogos"] 머지."""
raw = await select_run_raw_data(analysis_run_id)
official = await select_mainpage_logo_url(analysis_run_id)
_label = {
"instagram": "Instagram",
"facebook": "Facebook",
"youtube": "YouTube",
"instagram_en": "Instagram EN",
"facebook_en": "Facebook EN",
"tiktok": "TikTok",
}
logos = [{"channel": label, "url": img}
for key, label in _label.items()
if (img := (raw.get(key) or [{}])[0].get("logo_url"))]
logos = []
for key, label_prefix in _label.items():
if key in raw:
channel_list = raw.get(key)
for item in channel_list:
language = item["language"]
if language != "KR":
label = label_prefix + " " + language
else :
label = label_prefix
img = item.get("logo_url")
if img:
logos.append({"channel": label, "url": img})
if not logos:
logger.info("[channel_logos] skip — no channel profileImages")
return

View File

@ -111,7 +111,7 @@ def _page_patch(item: dict, channel_logos) -> dict:
if p:
p["language"] = item["language"]
p["label"] = label
p["logo"] = "로고 일치 (공식 로고)" if logo_data["is_official"] else "로고 불일치 (비공식 변형)"
p["logo"] = "일치 (공식 로고)" if logo_data["is_official"] else "불일치 (비공식 변형)"
p["logo_description"] = logo_data["logo_description"]
return p