Skip to content

fix(google_flights): serve airline logos from local gstatic assets - #136

Open
Lxr-max wants to merge 1 commit into
aiming-lab:mainfrom
Lxr-max:cursor/fix-google-flights-airline-logos-da32
Open

Lxr-max wants to merge 1 commit into
aiming-lab:mainfrom
Lxr-max:cursor/fix-google-flights-airline-logos-da32

Conversation

@Lxr-max

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

Copy link
Copy Markdown
Contributor

Summary

Reviewer takeover for #22 (Google Flights airline logos) on Lxr-max/WebHarbor. Stale author PR: #23.

#23 only retargeted seed_data.py from .svg to .png. That does not fix the published seed DB (126k rows still store /static/images/airlines/<slug>.svg), and the paired HF discussion #11 is a logos-only google_flights.tar.gz (~48 KB) that must not replace the full site archive.

This PR follows the same code-side fallback as ESPN #132:

  • Commit the 23 Google Flights gstatic 70px PNGs (/flights/airline_logos/70px/{IATA}.png) under sites/google_flights/static/icons/airlines/ (git-tracked, not HF-managed).
  • Resolve <img> URLs at render time so templates never request a missing file and never onerror-hide a broken image.
  • Prefer the committed IATA PNG over the published letter-tile SVGs; fall back to the on-disk DB path only when no PNG exists.
  • Point future seed_data.py rows at /static/icons/airlines/{airline_code}.png.

Does not touch Best Buy, the site registry, or .assets-revision.

Fixes #22.

Verification

python3 -m py_compile sites/google_flights/app.py sites/google_flights/seed_data.py
python3 sites/google_flights/tests/test_airline_logos.py

8/8 tests OK. Flask test_client against the pinned google_flights seed:

  • /flights, /search?q=Delta, /flight/<id> return 200 and emit /static/icons/airlines/{IATA}.png
  • those pages do not request /static/images/airlines/*.svg
  • GET /static/icons/airlines/{AA,DL,…,QF}.png200 image/png (PNG signature) for all 23 codes

Live Chromium against standalone Flask on :41007 (pinned seed copied to instance/):

  • /flights?from=JFK&to=LAX&depart=2024-01-01 shows the American Airlines gstatic mark
  • /search?q=Delta shows the Delta widget on every result row
  • /flight/733 “Other flights on this route” shows Qatar, JetBlue, Spirit, Delta, Frontier marks

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

Lineage

Item Detail
Issue #22
Stale author PR #23 (hqhq1025, seed path .svg.png only)
Stale HF PR https://huggingface.co/datasets/ChilleD/WebHarbor/discussions/11 (do not merge as a full-site archive)
Fork branch https://github.com/Lxr-max/WebHarbor/tree/cursor/fix-google-flights-airline-logos-da32

Seeded flights still store missing /static/images/airlines/<slug>.svg
paths (issue aiming-lab#22 / stale aiming-lab#23). Resolve marks at render time to committed
70px gstatic PNGs under static/icons/airlines/{IATA}.png so logos render
without waiting on HF discussion aiming-lab#11, whose tarball is logos-only.

Co-authored-by: Xuanrui Li <xuanrui.li@se24.qmul.ac.uk>
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.

Google Flights airline logo assets are missing

1 participant