This commit is contained in:
Trey t
2026-01-19 22:52:42 -06:00
parent a8b0491571
commit 6cddf601e3
15 changed files with 554 additions and 296 deletions

View File

@@ -92,14 +92,15 @@ class Game:
utc_dt = local_dt.astimezone(ZoneInfo("UTC"))
# Format season as string (e.g., 2025 -> "2025-26" for NBA/NHL, "2025" for MLB)
if self.sport in ("nba", "nhl"):
sport_lower = self.sport.lower()
if sport_lower in ("nba", "nhl"):
season_str = f"{self.season}-{str(self.season + 1)[-2:]}"
else:
season_str = str(self.season)
return {
"canonical_id": self.id,
"sport": self.sport,
"sport": self.sport.upper(), # iOS Sport enum expects uppercase (e.g., "NFL")
"season": season_str,
"game_datetime_utc": utc_dt.strftime("%Y-%m-%dT%H:%M:%SZ"),
"home_team_canonical_id": self.home_team_id,