This commit is contained in:
Trey t
2026-01-20 12:25:00 -06:00
parent fbfdf136ae
commit c49206bb7c
6 changed files with 359 additions and 17 deletions

View File

@@ -138,7 +138,9 @@ class Game:
@classmethod
def from_canonical_dict(cls, data: dict) -> "Game":
"""Create a Game from a canonical dictionary (iOS app format)."""
game_date = datetime.fromisoformat(data["game_datetime_utc"])
# Handle 'Z' suffix (fromisoformat doesn't support it before Python 3.11)
date_str = data["game_datetime_utc"].replace("Z", "+00:00")
game_date = datetime.fromisoformat(date_str)
# Parse season string (e.g., "2025-26" -> 2025, or "2025" -> 2025)
season_str = data["season"]