镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

soccer: use core's favourite-team check (2.37.0, requires core 3.6.2) - #571

Merged
ChuckBuilds merged 2 commits into
mainfrom
claude/soccer-core-favorite-check
Sep 29, 2026
Merged

ChuckBuilds merged 2 commits into
mainfrom
claude/soccer-core-favorite-check

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Soccer now uses core's FavoriteTeamCheck from src.common.favorite_team_check, as the other scoreboards do. It replaces soccer's own older check in manager.py, which the core module grew out of. The owner approved the change in log output. Nothing on the display changes.

Changes

  • Wiring: manager.py imports core's check directly (no bundled copy) and wires it like the other scoreboards.
    • Each league is checked against soccer/<ESPN code>, custom leagues included.
    • Only enabled leagues with favourites are checked.
    • One deliberate difference: on_config_change rebuilds the check instead of resetting it, because soccer's league list can change.
  • Dead code removed: the old check and its helpers (_abbreviates, _suggest_team_code, _fetch_league_teams, _fetch_season_start, _favorites_checked). Nothing else used them.
  • Minimum core 3.6.2: it includes LEDMatrix#670, without which the Europa League was called finished between matchdays.
  • Version and docs: 2.37.0 with a versions[] entry, CHANGELOG and plugins.json. The guard now covers soccer. Doc 08, CLAUDE.md and the TEAMS.md tip are updated.

What users will see in the log

League (live ESPN, 2026-09-29) Before After
Premier League, La Liga, Bundesliga, Serie A, Ligue 1, Liga Portugal, Champions League recognised nothing on until 9, 10 or 13 October 2026
MLS recognised recognised
Europa League (favourite AZ) recognised recognised (on core 3.6.1 this would wrongly say "season has finished")
FIFA World Cup recognised season has finished (correct)
Wrong code (eng.1, MUN) suggests MAN; see TEAMS.md suggests MAN; links ESPN's team list for that league

The check also runs on a background thread now. The old one ran inside update(), so a league's first update waited on up to two ESPN requests.

Verification

All runs are on core v3.6.2.

  • Rendering: all 24 soccer harness PNGs are byte-identical to main.
  • Tests: run_plugin_tests.py soccer-scoreboard gives 38/38, the same set as before.
  • Repo scripts: every scripts/test_*.py guard passes, and so do check_version_bump and update_registry --check.
  • Guard mutation check: removing core's import from soccer's manager is caught.

🤖 Generated with Claude Code

ChuckBuilds and others added 2 commits September 29, 2026 11:42
Soccer had its own favourite-team diagnostic in manager.py: the one #233
added, which #235 generalised into <sport>_favorite_check.py for the other
scoreboards and stage 2 promoted to core as src.common.favorite_team_check.
Soccer now uses core's, wired like the other scoreboards (the wiring is the
parked claude/sports-stage2-soccer-favcheck-parked branch's, minus its
bundled copy: the floor is 3.6.1 since the stage 2 sunset, so manager.py
imports `from src.common.favorite_team_check import FavoriteTeamCheck`
plainly):

- update() calls _check_favorite_teams(registry_snapshot) once. It builds
  the check lazily over every league in the registry -- a registry key is
  the league's ESPN code, predefined or custom (_load_custom_leagues keys
  custom leagues by their normalised league_code; the sanitised safe_key is
  only for attribute names) -- as {key: (LEAGUE_NAMES name, "soccer/<key>")},
  and schedules each enabled league with the favourites of the first of
  live / recent / upcoming that has any. Any exception is logged at debug
  and never escapes update().
- on_config_change drops the check instead of reset()ting it as the other
  scoreboards do: soccer's league list (custom leagues) can change, and the
  check's league table is fixed when it is built. The next update rebuilds
  it for the new list, so it reports again.
- Deleted from the plugin class, with nothing else using them:
  the old _check_favorite_teams body, _abbreviates, _suggest_team_code,
  _fetch_league_teams, _fetch_season_start and _favorites_checked.

Behaviour change (log only, approved): the check runs on a daemon thread
instead of inside update(); between matchdays a correct code logs the
next fixture's date where the old check logged "recognised" (on today's
ESPN data: Premier League "nothing on until 10 October 2026"); a finished
season with nothing published says so; a wrong code's warning links to the
league's ESPN team list instead of TEAMS.md; suggestions also match word
fragments. TEAMS.md's tip says what the log now reports.

Tests: test_favorite_team_diagnostics.py runs the Premier League cases
against the FavoriteTeamCheck manager.py imports, plus the wiring (enabled
leagues only, first mode with favourites, custom-league endpoints, a bad
registry entry never escaping). scripts/test_timezone_and_favorite_check_copies.py
adds soccer to FAVORITE_SUNSET. docs 08 and CLAUDE.md: only ufc is without
core's check.

Every harness render is byte-identical (24 PNGs; the check only logs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rounds)

Core 3.6.1's favourite check still called the Europa League's season
finished between matchdays; 3.6.2 (core #670) fixes it. Soccer is the
plugin that meets that case, so it floors on 3.6.2.

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

coderabbitai Bot commented Sep 29, 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: be9e2c40-861f-456c-96a0-06c499c2fd2f


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 -12 complexity

Metric Results
Complexity -12

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.

@ChuckBuilds
ChuckBuilds merged commit c97e66c into main Sep 29, 2026
5 checks passed
@ChuckBuilds
ChuckBuilds deleted the claude/soccer-core-favorite-check branch September 29, 2026 16:02
ChuckBuilds added a commit that referenced this pull request Sep 29, 2026
Eight manifests on main carried raw UTF-8 (em dashes, and baseball's
up/down arrows): clock-simple, ledmatrix-weather, pomodoro-timer and five
scoreboards (baseball, basketball, football, lacrosse, soccer; added in
#570/#571). Tools that open manifest.json in the platform default
encoding -- cp1252 on Windows: cores before 3.4.0 and the core's
scripts/dev_server.py -- garble those bytes, or raise UnicodeDecodeError
on characters whose UTF-8 includes a byte cp1252 leaves undefined.
Every other manifest already stores such characters as JSON escapes.

- Rewrite the eight with a text-level substitution to JSON escape
  sequences (formatting, key order and line endings unchanged;
  json.loads before == after), and PATCH-bump each with a new top
  versions[] entry. plugins.json synced by update_registry.py.
- scripts/check_manifests_ascii.py: fails on any raw non-ASCII byte in
  plugins/*/manifest.json, naming line, column and the escape to write;
  also flags a BOM or a legacy-encoded byte, and fails if it finds 40 or
  fewer manifests.
- scripts/test_check_manifests_ascii.py: regression suite, which also
  runs the guard over the real tree so CI's scripts/test_*.py glob
  enforces it.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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