Skip to content

fix(espn): avoid 404s for missing homepage league and team icons - #132

Open
Lxr-max wants to merge 2 commits into
aiming-lab:mainfrom
Lxr-max:cursor/fix-espn-homepage-icons-1a8e
Open

Lxr-max wants to merge 2 commits into
aiming-lab:mainfrom
Lxr-max:cursor/fix-espn-homepage-icons-1a8e

Conversation

@Lxr-max

@Lxr-max Lxr-max commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Completes the remaining ESPN half of #3. Booking homepage gallery 404s are already fixed on main (sites/booking/templates/index.html uses /static/images/screenshots/{paris,bali,rome}.png); this PR does not touch Booking.

The ESPN homepage (and other templates that reused the same paths) requested league/team PNGs that are not in the published asset bundle:

  • leagues: soccer, ncaaf, ncaam, ncaaw, tennis, golf, fantasy
  • soccer teams: psg, mia, rma

Existing nba / nfl / mlb / nhl (and mma) league icons are present. Hugging Face discussion https://huggingface.co/datasets/ChilleD/WebHarbor/discussions/9 has been open since May and is not merged, so this is a code-side fallback.

Change

  • Resolve league/team <img> URLs against the on-disk static/ tree at render time so missing files are never requested (onerror still 404s).
  • Alias college league icons to the closest shipped marks (ncaafnfl, ncaam/ncaawnba).
  • Remaining missing league slots and missing team marks use a committed SVG placeholder at sites/espn/static/icons/sport-placeholder.svg.
  • Soccer /teams cards use the existing color swatch when no club PNG ships.
  • If a later espn.tar.gz actually ships the named PNGs, those files are used automatically.

Verification

Against the current pinned ESPN HF assets (nba/nfl/mlb/nhl/mma league PNGs present; soccer/ncaaf/ncaam/ncaaw/tennis/golf/fantasy and soccer club PNGs absent):

  • python3 -m py_compile sites/espn/app.py
  • Flask test client: /, /soccer/, /soccer/teams, /soccer/scoreboard, /nba/, /nba/teams, /college-football/, /scores all 200
  • Homepage and those routes emit none of the 10 issue paths and return zero static 404s
  • Direct GET of the old paths still 404s (/static/images/espn/leagues/soccer.png, ncaaf.png, /static/images/espn/teams/soccer/psg.png); templates no longer request them
  • Browser (1280px) on local ESPN: homepage nav/rail icons render; soccer/tennis/golf/fantasy use the red placeholder; NBA/NFL/MLB/NHL use real marks; soccer team cards use color swatches for Inter Miami / PSG / Real Madrid; NBA team logos remain real

Docker image rebuild / /reset byte-identity was not re-run here (no Docker daemon; seed DB untouched).

Fixes #3

Resolve ESPN league/team <img> URLs against the on-disk static tree.
College sports alias to the shipped nba/nfl icons; remaining missing
slots (soccer, tennis, golf, fantasy, soccer clubs) use a committed SVG
placeholder. Real HF files are used when present, so a later espn.tar.gz
update needs no further template change.

Fixes #3

Generated-by: Cursor Cloud Agent (Grok 4.6)
League nav still aliases ncaaf/ncaam/ncaaw to shipped nfl/nba icons.
Missing club marks fall back to the shared placeholder so college and
soccer score rows are not all stamped with the same pro-league shield.

Generated-by: Cursor Cloud Agent (Grok 4.6)
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.

Broken homepage images in Booking and ESPN mirrors

1 participant