Spaces:
Sleeping
Sleeping
Update visualization/game_cards.py
Browse files
visualization/game_cards.py
CHANGED
|
@@ -92,12 +92,13 @@ def render_game_card(game: dict[str, Any]) -> None:
|
|
| 92 |
|
| 93 |
competition_bucket = _safe_text(game.get("competition_bucket"), "OTHER").upper()
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
|
|
|
| 101 |
|
| 102 |
away_score = _safe_score(game.get("away_score"))
|
| 103 |
home_score = _safe_score(game.get("home_score"))
|
|
|
|
| 92 |
|
| 93 |
competition_bucket = _safe_text(game.get("competition_bucket"), "OTHER").upper()
|
| 94 |
|
| 95 |
+
# Be robust to missing / incorrect competition_bucket on some score rows:
|
| 96 |
+
# always try MLB logo lookup first, then fall back to country flag lookup.
|
| 97 |
+
away_logo_url = get_team_logo_url(away_team)
|
| 98 |
+
home_logo_url = get_team_logo_url(home_team)
|
| 99 |
+
|
| 100 |
+
away_flag_url = away_logo_url or get_team_flag_url(away_team)
|
| 101 |
+
home_flag_url = home_logo_url or get_team_flag_url(home_team)
|
| 102 |
|
| 103 |
away_score = _safe_score(game.get("away_score"))
|
| 104 |
home_score = _safe_score(game.get("home_score"))
|