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

feat(scoreboards): pick favourite teams from a list instead of typing codes - #290

Merged
ChuckBuilds merged 2 commits into
mainfrom
feat/scoreboard-team-pickers
Aug 19, 2026
Merged

ChuckBuilds merged 2 commits into
mainfrom
feat/scoreboard-team-pickers

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Aug 16, 2026 •

Copy link
Copy Markdown
Owner

Why

favorite_teams was a free-text array with nothing validating it — just a description saying "use 2-3 letter codes":

{"type": "array", "items": {"type": "string"}, "default": [],
 "description": "List of favorite MLB team abbreviations (e.g., NYY, BOS, LAD)."}

A wrong or stale code saves cleanly and then matches nothing, and the result is an empty screen with no error anywhere. That's the same failure scripts/check_team_pickers.py was written to prevent for the pickers that already exist:

the picker simply does not offer a team that exists, or offers a code that no longer matches anything, and the user gets an empty screen with no error

What changed

The roster is now an enum with display names, rendered as the same checkbox-group widget the odds ticker already uses for exactly this purpose. MLB, NFL, NBA, WNBA and NHL.

College leagues deliberately keep the text field — a checkbox grid of several hundred teams is worse than typing one.

On the report that prompted it

A user found PHI didn't work for the Phillies while NYY worked for the Yankees. I could not reproduce that, and I'd rather say so than imply this fixes it:

  • ESPN's teams endpoint returns PHI (id 22, philadelphia-phillies)
  • Live game data also returns PHI — MIN (Minnesota Twins) vs PHI (Philadelphia Phillies)
  • PHI.png exists in assets/sports/mlb_logos/ on every machine checked
  • DynamicTeamResolver.resolve_teams passes PHI through unchanged, identically to NYY

A picker removes the whole class of mistake rather than that one instance. If the Phillies still don't appear with PHI selected from the list, that's a matching bug worth chasing separately, and the picker will have ruled out the config as the cause.

Tooling fix included

check_team_pickers.py derived the league key from a fixed trail offset (trail[-3]). Hockey nests its list one level deeper — .../nhl/properties/teams/properties/favorite_teams — so it reported the league as teams and failed with "unknown league key". It now walks back to the nearest segment that names a league.

All nine pickers validate:

OK  baseball-scoreboard: mlb (30)      OK  hockey-scoreboard: nhl (32)
OK  basketball-scoreboard: nba (30)    OK  odds-ticker: nfl/nba/mlb/nhl
OK  basketball-scoreboard: wnba (15)
OK  football-scoreboard: nfl (32)
OK: 9 picker(s) match ESPN.

Compatibility

Existing configurations are unaffected — the codes were already ESPN's, so anything valid today stays valid. Verified PHI, NYY and TB are all accepted by the new enum, and a plausible typo like PHL is not. default: [] and uniqueItems preserved.

Safety harness clean on all four plugins; the two failing tests are the pre-existing missing-src ones that also fail on main.

Summary by CodeRabbit

  • New Features

    • Favorite-team settings for MLB, NBA, WNBA, NFL, and NHL now use validated checkbox pickers with official team names.
    • Duplicate team selections are prevented where applicable.
    • College league configurations remain unchanged.
  • Improvements

    • Updated Baseball, Basketball, Football, and Hockey Scoreboard plugins to their latest releases.
    • Refined configuration descriptions for clearer symbols and formatting.
    • Updated the plugin catalog timestamp and release history.

Loading
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.

2 participants