This commit is contained in:
doms9 2025-09-21 15:24:47 -04:00
parent a726aaf89c
commit 00000d9d0d
4 changed files with 157 additions and 120 deletions

View file

@ -18,13 +18,18 @@ LEAGUES: dict[str, dict[str, str]] = json.loads(
def league_info(name: str) -> tuple[str | None, str]:
league_name_map: dict[str, tuple[str, str]] = {
league_name: (tvg_id, league_data.get("logo"))
for tvg_id, leagues in LEAGUES.items()
for league_entry in leagues
for league_name, league_data in league_entry.items()
}
if match := next(
(
(tvg_id, league_data.get("logo"))
for tvg_id, leagues in LEAGUES.items()
for league_entry in leagues
for league_name, league_data in league_entry.items()
if name == league_name or name in league_data.get("names", [])
),
None,
):
tvg_id, logo = match
tvg_id, logo = league_name_map.get(name, (None, None))
return (tvg_id, logo or live_img)
return tvg_id, logo or live_img
return (None, live_img)