fix: pin playoff card to its own gameNumber so the header doesn't tick forward after a final
CI / Lint (push) Successful in 10s
CI / Test (push) Successful in 10s
CI / Build & Push (push) Successful in 23s

series_state derives game_number from topSeedWins + bottomSeedWins + 1, which becomes the *next* game's number once the API advances seriesStatus post-final. The card for the just-finished game would then read "Game N+1 of 7". Prefer the raw gameNumber on the game payload, falling back to the derived value when it's missing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-19 18:41:04 -04:00
parent 13bb90b52b
commit e908139323
3 changed files with 22 additions and 3 deletions
+5 -1
View File
@@ -65,6 +65,7 @@ def make_playoff_game(
bottom_abbrev="BOS",
top_is_home=True,
game_state="LIVE",
game_number=None,
**kwargs,
):
"""Convenience wrapper around make_game for playoff fixtures.
@@ -87,7 +88,7 @@ def make_playoff_game(
home_abbrev, away_abbrev = bottom_abbrev, top_abbrev
home_name, away_name = "Bottom Seeds", "Top Seeds"
return make_game(
game = make_game(
game_state=game_state,
game_type=3,
series_status=series_status,
@@ -97,6 +98,9 @@ def make_playoff_game(
away_name=kwargs.pop("away_name", away_name),
**kwargs,
)
if game_number is not None:
game["gameNumber"] = game_number
return game
LIVE_GAME = make_game()