Repository navigation
fix(baseball, hockey): a win celebration is selectable as a live mode - #629
Merged
Merged
Conversation
A win fires as the game goes final, so the game has already left the live list. has_live_content() reported the celebration, but get_live_modes() only looked at live games and returned []; the display controller then saw live content with no league mode of this plugin to resolve it to. get_live_modes() now appends a celebrating league's live mode inside the same enabled + live_priority block football uses (MLB, MiLB, NCAA baseball; NHL, NCAA men's, NCAA women's), and dedupes so a celebration plus a live game in the same league lists the mode once. has_live_content() applies the same live_priority gate to celebrations, so the two methods agree. baseball-scoreboard 1.57.4, hockey-scoreboard 1.42.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 | 26 |
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.
ChuckBuilds
added a commit
that referenced
this pull request
Oct 5, 2026
…#630) get_live_modes() only returns a celebrating league's live mode when that league is enabled with live_priority on, but has_live_content() counted a celebration in any enabled league. With live priority off for that league the controller saw live content and got no mode of this plugin for it. has_live_content() now asks _get_active_celebration_manager( live_priority_only=True), the same gate baseball and hockey got in #629. needs_high_fps and the display takeover keep the ungated lookup. football-scoreboard 3.18.9. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
In baseball-scoreboard and hockey-scoreboard,
has_live_content()returned True during a win celebration whileget_live_modes()returned[]. A win fires as the game goes final, so the live list is already empty, andget_live_modes()had no celebration branch. The display controller (_collect_live_modes) then saw live content but got no league mode back from the plugin, and fell back to whichever*_livemode name it was scanning -- not necessarily the celebrating league.Football already carries the fix (
get_live_modes, celebration branch inside the enabled + live_priority block, thenlist(dict.fromkeys(...))).Fix
get_live_modes(): the football branch for every league -- MLB, MiLB, NCAA baseball; NHL, NCAA men's, NCAA women's -- inside the existingenabled and live_priority and hasattrblock, before the live-game filter. The return is deduped so a celebration plus a live game in the same league lists the mode once.has_live_content(): its celebration check now skips leagues withlive_priorityoff (_get_active_celebration_manager(live_priority_only=True), read from the league registry). Before this, a celebration in a league with live priority off madehas_live_content()True whileget_live_modes()could never return that league.needs_high_fpsand the display takeover still use the ungated lookup, so nothing changes there.test_live_content_log_throttle.pythat overrode_get_active_celebration_manager()now accepts the new keyword.Other scoreboards
has_live_content()has the same ungated celebration check that this PR gates here: with live priority off for a league, it still reports a celebration thatget_live_modes()won't return. This PR leaves football alone.Versions
Each has a new
versions[]entry and a CHANGELOG entry.plugins.jsonis regenerated.Tests
The new
test_celebration_is_a_live_mode.pyin each plugin has 14 cases, parametrized over every league:has_live_content()agrees;live_priorityoff, neither method reports the celebration.Mutation checks: each change, removed on its own, fails tests in both plugins.
has_live_contentgaterun_plugin_tests.py(core main c20c0be), branch vs main:The single baseball failure is the pre-existing
test_baseball_activity.py, on both.Guards:
scripts/test_*.pypass.check_sports_driftpasses with no baseline change.update_registry.py --check,check_version_bump.py --base origin/main baseball-scoreboard hockey-scoreboard.check_plugin.pysafety harness passes for both plugins.🤖 Generated with Claude Code