Skip to content

fix(soccer-scoreboard): a per-league mode shows only its own league (2.39.4) - #618

Merged
ChuckBuilds merged 3 commits into
mainfrom
claude/soccer-per-league-mode-scope
Oct 4, 2026
Merged

ChuckBuilds merged 3 commits into
mainfrom
claude/soccer-per-league-mode-scope

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Bug

Soccer registers one set of modes per league (soccer_eng.1_recent, soccer_esp.1_recent, ...). In switch mode, SoccerScoreboardPlugin.display() parsed the league out of soccer_<league>_<type> and then ignored it: it looped over every league from _get_enabled_leagues_for_mode(mode_type) and drew the first manager with games. So soccer_esp.1_recent showed the eng.1 card (seen locally and on the ledpi rig), and every league's slot could repeat the same game.

Fix

The per-league branch now consults only the league named in the mode. It still has to be in _get_enabled_leagues_for_mode(mode_type), so a league or mode that is switched off shows nothing. When that league has nothing to show, display() returns False and core's empty-mode handling moves on. The legacy soccer_live / soccer_recent / soccer_upcoming branch is unchanged. Core no longer registers those names, and pooling every league is what they are meant to do.

Version 2.39.4, with a versions[] entry, a CHANGELOG entry, a one-line README note and the regenerated plugins.json.

Other plugins checked

  • afl / nrl / ufc / cricket: they register <sport>_live/_recent/_upcoming with no league in the name, so they don't have this bug.
  • lacrosse (lax_<league>_<type>): already scoped. It resolves the league against its registry and calls _display_league_mode(league, ...).
  • basketball / hockey / football / baseball (<league>_<type>): already scoped. They parse the league and call _display_league_mode(league, ...). Their cross-league loop runs only for the legacy combined <sport>_<type> names, the same as soccer's soccer_<type> branch.

Only soccer is changed.

Not changed (pre-existing, outside this branch)

  • Scroll mode. For a per-league mode, _display_scroll_mode still builds one strip from every scroll-mode league. _should_use_scroll_mode(mode_type) is also true if any enabled league scrolls that type.
  • Celebrations. A goal celebration takes over any _live mode, whichever league it belongs to.

These look like deliberate cross-league behaviour, so they are left alone here.

Tests

  • New plugins/soccer-scoreboard/test_per_league_mode_scope.py. It covers: an empty esp.1 slot returns False and never draws eng.1 (for live, recent and upcoming); each league's slot draws its own league, not the higher-priority one; a custom league code containing underscores; and a disabled league's mode. All four tests fail on main and pass with the fix.
  • test/test_empty_mode_no_blank.py::test_empty_manager_is_skipped asserted the old pooling: soccer_usa.1_recent drew fifa.world's game. It now asserts the usa.1 slot returns False without drawing either league, and that fifa.world draws in its own slot. The empty-manager gate it guards is still checked.
  • run_plugin_tests.py soccer-scoreboard --core <fresh LEDMatrix main>: 40 passed, 0 failed.
  • Every scripts/test_*.py with LEDMATRIX_CORE set to a fresh LEDMatrix main clone: 47 of 47 passed (Python 3.14, Pillow 12.3).
  • Each of these passes: check_version_bump.py --base origin/main soccer-scoreboard, check_manifest_version_fields.py soccer-scoreboard, check_sports_helpers_parity, check_module_collisions, check_sports_drift, check_min_core_version, check_sports_display_contract, check_scroll_adoption, check_manifests_ascii, and update_registry.py --check.

Merge order with #615

#615 (soccer 2.39.3, fetch-burst fix) also edits soccer's manifest.json, CHANGELOG.md and plugins.json. This PR uses 2.39.4 so both can land. Merge #615 first, then rebase this PR onto main. Keep #615's 2.39.3 versions[] and CHANGELOG entries below this PR's 2.39.4 entries, and rerun update_registry.py. If this PR merges first instead, #615 has to be renumbered above 2.39.4.

🤖 Generated with Claude Code

…2.39.4)

display() parsed the league out of soccer_<league>_<type> in switch mode and
then tried every enabled league's manager for that type, drawing the first
with games -- so soccer_esp.1_recent showed the eng.1 card. Only the named
league is consulted now; when it has nothing the mode returns False so the
core's empty-mode handling moves on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 549d56a5-014d-4012-9ef0-015f52516649
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 24 complexity

Metric Results
Complexity 24

View in Codacy

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.

# Conflicts:
#	plugins.json
#	plugins/soccer-scoreboard/CHANGELOG.md
#	plugins/soccer-scoreboard/manifest.json
@ChuckBuilds
ChuckBuilds merged commit e73d209 into main Oct 4, 2026
5 checks passed
@ChuckBuilds
ChuckBuilds deleted the claude/soccer-per-league-mode-scope branch October 4, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant