Repository navigation
fix(ufc-scoreboard): load the separator icon the plugin ships (1.19.4) - #616
Merged
Merged
Conversation
The scroll display only looked for assets/sports/ufc_logos/UFC.png relative to the working directory, the LEDMatrix install root on a Pi. The core has never shipped that file. The plugin has shipped its own copy since it was added (#24), but nothing read it, so every install logged "UFC separator icon not found" each time the scroll display was built (25 times in one harness run) and the Vegas ticker ran UFC's fights with no separator. Fall back to the plugin's copy, resolved from __file__. The core path is tried first, so a PNG there still overrides it; with neither, skip quietly at debug ("will skip separator"), as baseball, basketball, afl, nrl and soccer do. The core path stays referenced, so it stays in UNSHIPPED_SEPARATOR_ICONS; only its comment changes. generate_placeholder_icon.py now writes the bundled file instead of a cwd-relative one, and its docstring no longer implies a manual step. 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.
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
Every UFC install logs
UFC separator icon not found at assets/sports/ufc_logos/UFC.pngeach time the scroll display is built. One core harness run logged it 25 times. The Vegas ticker also runs UFC's fights with no separator._load_separator_iconsonly looked at that path relative to the working directory, which is the LEDMatrix install root on a Pi. Core has never shipped the file (git ls-tree -r origin/main assets/sportshas no ufc/mma entry, and no commit in its history touchesassets/sports/ufc_logos/).plugins/ufc-scoreboard/assets/sports/ufc_logos/UFC.pngsince it was added (feat(ufc): add UFC scoreboard plugin #24), but nothing read it.generate_placeholder_icon.pywrote a cwd-relative file, but only when run by hand, and nothing documented it.Change
I chose to load the bundled icon rather than only quieting the warning, as #614 did for baseball and basketball. The fix needs no new asset, and UFC is the plugin's only league, so quieting it would have left the separator permanently off.
ScrollDisplayManagertriesUFC_SEPARATOR_ICON(core path) first, so a PNG there still overrides. It then falls back toBUNDLED_SEPARATOR_ICON, resolved from__file__, as cricket, flights and geochron already do for their assets.UNSHIPPED_SEPARATOR_ICONS(from fix: plugin asset paths that miss on the Pi's case-sensitive filesystem (leaderboard 1.5.6, baseball 1.57.1, basketball 1.42.1, hockey 1.42.3) #614); only its comment changes.generate_placeholder_icon.pynow writes the bundled file, and its docstring no longer implies a manual step.show_league_separatorsrow and CHANGELOG updated; manifest 1.19.3 -> 1.19.4 (patch: a documented setting that never took effect now does).plugins.jsonsynced.Visible change: the Vegas ticker now draws the octagon before UFC's fight cards. It is 28x28 at 32 px tall and 60x60 at 64 px, centred, inside the panel edge. The plugin's own switch modes are unchanged.
Testing
All run against a fresh
git archiveof coreorigin/main(2236ff30):plugins/ufc-scoreboard/test_separator_icons.py(standalone, exit 0/1/2), run from a scratch cwd so it doesn't depend on a core checkout'sassets/. It checks that the bundled icon loads atdisplay_height - 4for 32 and 64 px panels, that a core-path file overrides it, and that with neither present it is skipped. In all three cases nothing about separators is logged above DEBUG. On the old loader it fails 5 checks (no separator, plus the warning).scripts/run_plugin_tests.py ufc-scoreboard: 28 passed, 0 skipped, 0 failed.check_plugin.py --plugin ufc-scoreboard: all 16 goldens match. The Vegas check goes from 4 elements to 5 (the separator). Its card-width notes and font log lines are identical before and after.scripts/test_*.pypasses (47), includingtest_core_asset_paths.py.check_version_bump --base origin/main ufc-scoreboard,update_registry.py --check,check_module_collisions,check_manifests_ascii,check_manifest_version_fields,check_min_core_version,check_sports_driftandcheck_core_api_signaturesall pass.Notes for reviewer
plugins.jsonhas nocommit.update_registry.pywould stamp this branch's commit, which won't exist after a squash merge; the registry job onmainfills it in.🤖 Generated with Claude Code