fix(assets): drop case-colliding duplicate league logos - #506
Conversation
Four league fallback logos were each tracked at two paths differing only in case: assets/sports/mlb_logos/MLB.png + mlb.png assets/sports/nba_logos/NBA.png + nba.png assets/sports/nfl_logos/NFL.png + nfl.png assets/sports/nhl_logos/NHL.png + nhl.png On Windows and default macOS the filesystem is case-insensitive, so both index entries map to one physical file. Whichever git writes last wins and the other entry reports as permanently modified, so `git status` can never be clean and any `git pull` flips which one is dirty. For MLB/NBA/NFL the two entries pointed at the same blob, so the collision was only cosmetic. NHL was not: NHL.png is 1439x1621 (672455 B) and nhl.png is 768x768 (107184 B), so which resolution the league fallback logo loaded depended on checkout order rather than on the code. Keep the uppercase path in each pair. Every logo lookup uppercases the abbreviation before building a filename -- LogoDownloader .normalize_abbreviation and .get_logo_filename_variations (src/logo_downloader.py) and LogoHelper.normalize_abbreviation (src/common/logo_helper.py) all do -- and nothing in the tree requests a lowercase league logo, so the uppercase name is what the code actually asks for. For NHL that is also the higher-resolution asset. Removed with `git update-index --force-remove` so the literal index entry is dropped without the case-insensitive working tree deleting the survivor.
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (4)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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
|
Problem
Four league fallback logos were each tracked at two paths differing only in case:
Reproduce with:
On Windows and default macOS the filesystem is case-insensitive, so both index entries map to a single physical file. Whichever git writes last wins, the other reports as permanently modified, and
git statuscan never be clean — anygit pullflips which one is dirty.A fresh clone of
mainon Windows today:For MLB/NBA/NFL both entries pointed at the same blob, so the collision was cosmetic. NHL was not:
NHL.pnge3287a787enhl.pngeaebd59425So which resolution the league fallback logo actually loaded depended on checkout order rather than on the code. On a fresh Windows clone of
main,NHL.pngon disk currently holds the 107184-byte 768×768 blob — the low-res one — even though the code asks forNHL.png.Fix
Keep the uppercase path in each pair.
Every logo lookup uppercases the abbreviation before building a filename:
LogoDownloader.normalize_abbreviation()—normalized = abbreviation.upper()(src/logo_downloader.py:130)LogoDownloader.get_logo_filename_variations()—original = abbreviation.upper(), thenf"{original}.png"/f"{normalized}.png"(src/logo_downloader.py:146-159)LogoHelper.normalize_abbreviation()—team_abbr.strip().upper()(src/common/logo_helper.py:193-217)There is no case-insensitive or lowercase filename lookup anywhere in the tree, and nothing in
src/,test/,scripts/, orweb_interface/references a lowercase league logo by name. The uppercase name is what the code actually requests — and for NHL it is also the higher-resolution asset.Removal used
git update-index --force-removeon the literal index path, so the entry is dropped without the case-insensitive working tree deleting the survivor.git rmhere would have matched case-insensitively and taken out the wrong file.Verification
Fresh
git cloneof this branch on Windows (NTFS,core.ignorecase=true):git status --porcelain→ emptygit ls-files | tr 'A-Z' 'a-z' | sort | uniq -d→ emptyassets/sports/nhl_logos/NHL.png→ 672455 B, 1439×1621 ✅No code changes; no references to the removed paths exist.
Found incidentally while running the plugin safety harness for a football-scoreboard fix. Unrelated to that change, so it was deliberately left out of that PR.