From c77d014a014edb4a5c72d2ad58aeba3c83904df3 Mon Sep 17 00:00:00 2001 From: hbyang Date: Sat, 13 Jun 2026 10:58:33 +0900 Subject: [PATCH] Fix auto-settle for non-Group-A: map results by TLA, not full name _results_football_data resolved team codes via code_for(full name), which only covered Group A teams, so FINISHED matches in other groups (e.g. Canada vs Bosnia-Herzegovina) were silently dropped and never settled. Use tla -> code_for_tla (same as schedule ingestion; covers all 48), with full-name fallback. Verified: source FINISHED 2 -> 3, CAN-BIH settles 1-1. Co-Authored-By: Claude Opus 4.8 (1M context) --- backend/app/services/schedule_fetch.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/app/services/schedule_fetch.py b/backend/app/services/schedule_fetch.py index a185e39..8a1b5a5 100644 --- a/backend/app/services/schedule_fetch.py +++ b/backend/app/services/schedule_fetch.py @@ -221,8 +221,12 @@ async def _results_football_data() -> list[dict]: for m in data.get("matches", []): if m.get("status") != "FINISHED": continue - a = code_for((m.get("homeTeam") or {}).get("name", "") or "") - b = code_for((m.get("awayTeam") or {}).get("name", "") or "") + ht = m.get("homeTeam") or {} + at = m.get("awayTeam") or {} + # 일정 수집과 동일하게 tla(3글자) → 코드. 풀네임 매핑(code_for)은 일부 팀만 + # 커버해 누락이 생기므로 tla 우선, 없을 때만 풀네임 폴백. + a = code_for_tla(ht.get("tla") or "") or code_for(ht.get("name") or "") + b = code_for_tla(at.get("tla") or "") or code_for(at.get("name") or "") if not a or not b: continue ft = ((m.get("score") or {}).get("fullTime") or {})