Skip to content

fix(odds-ticker): restore team logos for NCAA basketball and baseball - #256

Merged
ChuckBuilds merged 1 commit into
mainfrom
fix/odds-ticker-team-logos
Aug 5, 2026
Merged

fix(odds-ticker): restore team logos for NCAA basketball and baseball#256
ChuckBuilds merged 1 commit into
mainfrom
fix/odds-ticker-team-logos

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Reported as "the odds ticker shows game info but no team logos". Investigating it turned up a definite cause — though not for the game that prompted the report; see the honesty note at the end.

The bug

_get_team_logo() discarded the logo directory the data fetcher had already resolved for the league (_ = logo_dir) and looked the league up in a hardcoded map instead. That map had drifted out of sync with the fetcher:

logo_league the fetcher emits in the renderer's map?
nfl, mlb, nba, nhl, milb, ncaa_fb yes
ncaam_basketball no
ncaa_baseball no

Both resolved to no directory and returned None for every team, in every game.

Why nobody could see it

The failure was invisible from both directions, which is why it survived:

  • On screen the layout reserves logo_size width unconditionally, but only draws if home_logo:. A missing logo is therefore a blank gap, not a closed-up row — the game renders normally with empty space where the logos belong, which reads as a layout quirk rather than a failure.
  • In the logs the miss was recorded at debug, so at the default level there was nothing to explain the gap.

The fix

Fixed at the root rather than by adding the two absent keys. The renderer now tries the directory it was handed first and falls back to the map, so a league added to the fetcher works here without a second table having to be updated in lockstep — the exact drift that caused this. The map is completed too, for callers that pass no directory.

Missing logos now warn once per team, naming every path searched.

Verification

Against the real assets on a live 512x64 device, resolving a genuine team for each league the fetcher can emit — both with logo_dir and with it omitted so the fallback map carries it alone:

BEFORE   [MISS] ncaam_basketball   ALA   no logo -> blank gap
         [MISS] ncaa_baseball      ALA   no logo -> blank gap
         4 failure(s)

AFTER    [ok] mlb, nfl, nba, nhl, ncaa_fb, ncaam_basketball, ncaa_baseball
         0 failure(s)

Core harness passes at 128x32 and 512x64.

Honesty note on the original report

The report named a Rays game, and MLB was already workingTB.png resolves, and rendering the real Rays game (event 401816411) end-to-end through this renderer draws both team logos correctly. So this PR is not the explanation for that particular sighting. It is a real instance of the same failure, found while chasing it.

If a missing logo recurs on MLB, the new warning will now name the exact directories searched, which is what was missing to diagnose it the first time.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Udr6MfaFLUPhX5Fgo67Jf5

Summary by CodeRabbit

  • Bug Fixes

    • Improved team logo handling for NCAA basketball and baseball odds.
    • Added fallback behavior when the configured logo directory is unavailable.
    • Reduced repeated warnings for teams with missing logos.
    • Improved diagnostics when logos cannot be found or loaded.
  • Release

    • Updated the Odds Ticker plugin to version 1.1.10.

`_get_team_logo()` discarded the logo directory the data fetcher had
already resolved for the league (`_ = logo_dir`) and looked the league up
in a hardcoded map instead. That map had drifted: the fetcher emits
`ncaam_basketball` and `ncaa_baseball`, and the map had neither, so both
resolved to no directory and returned None for every team.

The failure was invisible from both sides. On screen the layout reserves
`logo_size` width unconditionally but only draws a logo `if home_logo:`,
so a missing logo is a blank gap rather than a closed-up row -- the game
renders with its info and empty space where the logos belong. In the logs
the miss was recorded at debug, so nothing showed up at the default level
to explain the gap.

Fixed at the root rather than by adding the two absent keys: the renderer
now tries the directory it was handed first and falls back to the map,
which means a league added to the fetcher works here without a second
table being updated in lockstep. The map is completed as well, for
callers that pass no directory.

Missing logos now warn once per team, naming every path searched.

Verified against the assets on a live 512x64 device, resolving a real
team for each league the fetcher can emit, with and without logo_dir:
before, ncaam_basketball and ncaa_baseball failed both ways (4 failures);
after, all seven leagues resolve. MLB was already working -- rendering a
real Rays game end-to-end draws both team logos correctly -- so this is
not the cause of every missing-logo report, but it is a real one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Udr6MfaFLUPhX5Fgo67Jf5
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 48863eb7-58a7-4451-9ce5-de87d9919bdb

📥 Commits

Reviewing files that changed from the base of the PR and between 2c35486 and f8bc835.

📒 Files selected for processing (3)
  • plugins.json
  • plugins/odds-ticker/manifest.json
  • plugins/odds-ticker/odds_renderer.py

📝 Walkthrough

Walkthrough

The odds ticker now uses league-specific logo fallbacks, supports NCAA basketball and baseball directories, and limits missing-logo warnings to one per team. Plugin metadata and release notes now identify version 1.1.10.

Changes

Odds ticker logo resolution

Layer / File(s) Summary
Renderer logo lookup and warnings
plugins/odds-ticker/odds_renderer.py
OddsRenderer tries the caller-provided directory and mapped league directories. It logs failed loads and reports each missing team logo once.
Version and release metadata
plugins.json, plugins/odds-ticker/manifest.json
Plugin metadata now reports version 1.1.10, the 2026-08-05 update date, and release notes for the logo changes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OddsRenderer
  participant LogoFilesystem
  participant Logger
  OddsRenderer->>LogoFilesystem: Try caller-provided logo directory
  OddsRenderer->>LogoFilesystem: Try mapped league directories
  LogoFilesystem-->>OddsRenderer: Return logo or load failure
  OddsRenderer->>Logger: Warn once for missing (league, team)
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the fix for missing NCAA basketball and baseball team logos, which matches the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/odds-ticker-team-logos

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

Metric Results
Complexity 6

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 5411354 into main Aug 5, 2026
4 checks passed
@ChuckBuilds
ChuckBuilds deleted the fix/odds-ticker-team-logos branch August 5, 2026 22:26
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