From ab3fd4d1962f4d6049e5f230e67fb10eff65b088 Mon Sep 17 00:00:00 2001 From: Chuck Date: Wed, 8 Apr 2026 08:40:41 -0400 Subject: [PATCH] fix(logos): register NCAA lacrosse + women's hockey in logo downloader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The lacrosse-scoreboard plugin renders broken on hardware: school logos never appear, and SportsRecent/SportsUpcoming _draw_scorebug_layout() falls into its "Logo Error" fallback branch instead of drawing the normal logo-centric scorebug. Root cause: src/logo_downloader.py LOGO_DIRECTORIES and API_ENDPOINTS were missing entries for ncaam_lacrosse and ncaaw_lacrosse, even though the plugin's manager files set those exact sport_key values (ncaam_lacrosse_managers.py:29, ncaaw_lacrosse_managers.py:29). The plugin's vendored sports.py asks the main LogoDownloader to resolve sport_key → on-disk directory the same way every other sports plugin does (football, basketball, baseball, hockey), and get_logo_directory() fell through to the safe fallback f'assets/sports/{league}_logos' = 'assets/sports/ncaam_lacrosse_logos', a directory that does not exist. Logo loads then failed for every team and the scorebug layout collapsed to "Logo Error". Adding the two lacrosse rows (and the missing ncaaw_hockey row in API_ENDPOINTS, while we're here) makes lacrosse a first-class peer to the other NCAA sports — same shared assets/sports/ncaa_logos directory, same canonical ESPN team-list endpoint pattern. No plugin-side change is needed because the plugin already imports the main LogoDownloader. Existing NCAA football/hockey schools that also play lacrosse (DUKE, UVA, MD, NAVY, ARMY, YALE, SYR, …) get picked up immediately on first render. Lacrosse-specific schools (JHU, Loyola, Princeton, Cornell, Stony Brook, …) lazily download into the shared directory via download_missing_logo() the first time they appear in a scoreboard payload — verified locally with both the team_id fallback path (ESPN sports.core.api) and the direct logo_url path used by the plugin at runtime. Verification (all from a clean clone): python3 -c " from src.logo_downloader import LogoDownloader d = LogoDownloader() for k in ('ncaam_lacrosse','ncaaw_lacrosse','ncaam_hockey','ncaaw_hockey'): print(k, '->', d.get_logo_directory(k)) " # All four print .../assets/sports/ncaa_logos python3 -c " from pathlib import Path from src.logo_downloader import download_missing_logo ok = download_missing_logo( 'ncaam_lacrosse', team_id='120', team_abbreviation='JHU', logo_path=Path('assets/sports/ncaa_logos/_jhu_test.png'), logo_url='https://a.espncdn.com/i/teamlogos/ncaa/500/120.png', ) print('downloaded:', ok) # True, ~40KB PNG " Co-Authored-By: Claude Opus 4.6 (1M context) --- src/logo_downloader.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/logo_downloader.py b/src/logo_downloader.py index 41329a45..ab696355 100644 --- a/src/logo_downloader.py +++ b/src/logo_downloader.py @@ -43,6 +43,9 @@ class LogoDownloader: 'ncaaw': 'https://site.api.espn.com/apis/site/v2/sports/basketball/womens-college-basketball/teams', # Alias for basketball plugin 'ncaa_baseball': 'https://site.api.espn.com/apis/site/v2/sports/baseball/college-baseball/teams', 'ncaam_hockey': 'https://site.api.espn.com/apis/site/v2/sports/hockey/mens-college-hockey/teams', + 'ncaaw_hockey': 'https://site.api.espn.com/apis/site/v2/sports/hockey/womens-college-hockey/teams', + 'ncaam_lacrosse': 'https://site.api.espn.com/apis/site/v2/sports/lacrosse/mens-college-lacrosse/teams', + 'ncaaw_lacrosse': 'https://site.api.espn.com/apis/site/v2/sports/lacrosse/womens-college-lacrosse/teams', # Soccer leagues 'soccer_eng.1': 'https://site.api.espn.com/apis/site/v2/sports/soccer/eng.1/teams', 'soccer_esp.1': 'https://site.api.espn.com/apis/site/v2/sports/soccer/esp.1/teams', @@ -73,6 +76,8 @@ class LogoDownloader: 'ncaa_baseball': 'assets/sports/ncaa_logos', 'ncaam_hockey': 'assets/sports/ncaa_logos', 'ncaaw_hockey': 'assets/sports/ncaa_logos', + 'ncaam_lacrosse': 'assets/sports/ncaa_logos', + 'ncaaw_lacrosse': 'assets/sports/ncaa_logos', # Soccer leagues - all use the same soccer_logos directory 'soccer_eng.1': 'assets/sports/soccer_logos', 'soccer_esp.1': 'assets/sports/soccer_logos',