fix(scoreboards): fetch odds for the finals every Recent screen selects - #352
Merged
Merged
Conversation
Ports football-scoreboard 2.29.3 (#344) to the eight sibling scoreboards: afl, basketball, hockey, lacrosse, nrl, soccer, baseball and ufc. In every one, SportsUpcoming fetches odds for the games that survive selection and SportsLive fetches them per included game — the Recent screen never fetched them at all, so its "odds if available" renderer never had anything attached and every final rendered bare. Football only surfaced the bug because its display-path rotation attached odds to rotated-in finals by accident; none of these plugins has that rotation, so their finals were bare in every configuration. Each Recent update() now runs the same post-selection loop Upcoming does, bounded by the selected list, never the schedule window. ESPN keeps a completed game's closing line on the same endpoint, so a final is as answerable as an upcoming game. test_recent_games_get_odds.py ported to all eight (probe-subclass style, no network): odds requested for exactly the selected finals, in-progress games not asked about, show_odds off means no requests. Basketball's probe carries tournament_mode; lacrosse's existing test_favorite_live_boost.py recent stub gains the show_odds attribute update() now reads — the same stub gap football's CI hit in #345. Full test sweep across all eight plugins passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWe8ZdMQ1itP25XyzrwnhW
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 72 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports football-scoreboard 2.29.3 (#344) to the eight sibling scoreboards, consolidated into one PR per maintainer request: afl 1.17.3, basketball 1.24.3, hockey 1.20.3, lacrosse 1.19.3, nrl 1.16.3, soccer 2.19.3, baseball 1.35.3, ufc 1.7.3.
The bug
In every one of these plugins,
SportsUpcomingfetches odds for the games that survive selection andSportsLivefetches them per included game — butSportsRecent.update()never fetched them at all. The Recent renderer'sif "odds" in gamewas dead code: nothing on that path ever attached odds, so every final rendered bare, withshow_oddson. Football only surfaced the bug (NFL recents showed lines, NCAA's didn't) because its display-path rotation attached odds to rotated-in finals by accident; none of these eight has that rotation, so their finals were bare in every configuration. Verified by class-region audit: zero_fetch_oddscalls in each plugin'sSportsRecentbefore this change. Immediately user-visible once seasons start — NHL recents on any board running hockey-scoreboard, for example.The fix
Each
SportsRecent.update()now runs the same post-selection loop its ownSportsUpcomingalready has —if self.show_odds: for game in team_games: self._fetch_odds(game)— bounded by the selected list, never the schedule window. ESPN keeps a completed game's closing line on the same endpoint, so a final is as answerable as an upcoming game. The insertion point and surrounding structure are identical across all eight forks (verified before patching); the code is byte-identical in each.Tests
test_recent_games_get_odds.pyported to all eight plugins (probe-subclass style, no network, no hardware): odds requested for exactly the selected finals; in-progress games in the feed not asked about;show_oddsoff means no requests. Basketball's probe carries itstournament_modeflag.test_favorite_live_boost.pyrecent stub gains theshow_oddsattributeupdate()now reads — the same stub-lag football's CI hit in fix(football-scoreboard): full card turns on mode re-entry, honest lookahead window, real advisory dates #345, caught here before CI this time.test_*.pyin all eight plugins runs clean (environment-dependent skips aside).🤖 Generated with Claude Code
https://claude.ai/code/session_01SWe8ZdMQ1itP25XyzrwnhW