fix: suppress misleading "Game X of 7" on future-date playoff cards
FUT games from the score API carry the current seriesStatus, not the anticipated state, so all future games in a series computed the same game number. Skip the summary for FUT games; badges and blurbs still render. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -158,6 +158,8 @@ def series_badges(game):
|
|||||||
|
|
||||||
def series_summary(game):
|
def series_summary(game):
|
||||||
"""Short line rendered above the card, e.g. 'Game 2 of 7'."""
|
"""Short line rendered above the card, e.g. 'Game 2 of 7'."""
|
||||||
|
if game.get("gameState") == "FUT":
|
||||||
|
return ""
|
||||||
state = series_state(game.get("seriesStatus", {}))
|
state = series_state(game.get("seriesStatus", {}))
|
||||||
return f"Game {_game_number(game, state)} of 7"
|
return f"Game {_game_number(game, state)} of 7"
|
||||||
|
|
||||||
|
|||||||
@@ -181,6 +181,10 @@ class TestSeriesSummary:
|
|||||||
)
|
)
|
||||||
assert series_summary(game) == "Game 2 of 7"
|
assert series_summary(game) == "Game 2 of 7"
|
||||||
|
|
||||||
|
def test_fut_game_suppresses_summary(self):
|
||||||
|
game = make_playoff_game(top_wins=1, bottom_wins=1, game_state="FUT")
|
||||||
|
assert series_summary(game) == ""
|
||||||
|
|
||||||
|
|
||||||
class TestIsPinned:
|
class TestIsPinned:
|
||||||
def test_game7_live_is_pinned(self):
|
def test_game7_live_is_pinned(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user