From 0ebd173af7d6a9315cbf3e9d6fb833a3bbd6eddd Mon Sep 17 00:00:00 2001 From: Mathieu Moran Date: Mon, 7 Sep 2026 19:46:50 -0400 Subject: [PATCH] ps1: IGDB-first only for EBOOT icon, restore usual library order Library covers go back to libretro -> OpenVGDB -> ScreenScraper -> Wikipedia -> IGDB (last resort) for all systems, including PS1. The EBOOT ICON0 (ps1_art) alone now tries IGDB first for clean banner-less box art, falling back to the normal pipeline. --- app/covers.py | 88 +++++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/app/covers.py b/app/covers.py index 7f2b00d..c1794dd 100644 --- a/app/covers.py +++ b/app/covers.py @@ -1089,16 +1089,30 @@ def _draw_platform_badge(p, label, x, y, color, QRectF, QColor, QFont, def ps1_art(title, release_id, timeout=10): """Fetch a PS1 game's cover and build ``(icon0, pic0, pic1)`` PNG bytes. - Reuses the local cover cache when available, otherwise searches the PS1 - sources (libretro, ScreenScraper, IGDB, Wikipedia). The description and - ESRB rating for the PIC0 info board come from IGDB (best effort). + The EBOOT icon prefers IGDB first (clean box art without the PlayStation + banner that libretro/ScreenScraper thumbnails bake in); if IGDB has + nothing it falls back to the normal cover pipeline (libretro, OpenVGDB, + ScreenScraper, Wikipedia, IGDB). The description and ESRB rating for the + PIC0 info board come from IGDB (best effort). Returns ``(None, None, None)`` when no art can be produced. """ key = release_id or stable_key(title) + path = None try: - path = fetch_cover(title, key, "ps1", timeout=timeout) + # IGDB first for the icon: clean box art without the banner. + data = _fetch_igdb_cover(title, min(timeout, 6), system="ps1") + if data is not None: + dest = cover_path(key, "ps1") + _write_atomic(dest, data) + path = dest + log.info("ps1 icon cover %r <- igdb", title) except Exception: # noqa: BLE001 - return None, None, None + path = None + if path is None: + try: + path = fetch_cover(title, key, "ps1", timeout=timeout) + except Exception: # noqa: BLE001 + return None, None, None if path is None: return None, None, None @@ -1166,42 +1180,34 @@ def fetch_cover(name, release_id, system, timeout=10, quick=False): if data is not None: log.info("cover %r <- manual", name) elif system != "videos": - # 2. PS1: IGDB first — its covers are clean box art without the - # PlayStation banner that libretro/ScreenScraper thumbnails bake in - # (redundant with our ICON0 frame). Games: libretro first, then the - # shipped OpenVGDB bundle (offline), then ScreenScraper (non-quick), - # then Wikipedia (keyless), then IGDB last. - data = None - if system == "ps1" and not quick and time.time() < deadline: - data = _fetch_igdb_cover(name, t, system=system) - if data is not None: - log.info("cover %r <- igdb", name) - if data is None: - data = _fetch_libretro(name, t, system=system, indexed_only=quick) - if data is not None: - log.info("cover %r <- libretro", name) - else: - data = None - if system == "games": - data = fetch_openvgdb_local(name) - if data is not None: - log.info("cover %r <- openvgdb", name) - if data is None and not quick and time.time() < deadline: - data = _fetch_screenscraper(name, t, system=system) - if data is not None: - log.info("cover %r <- screenscraper", name) - if data is None and not quick and time.time() < deadline: - data = _fetch_wikipedia_cover(name, t) - if data is not None: - log.info("cover %r <- wikipedia", name) - if data is None and system != "ps1" and time.time() < deadline: - data = _fetch_igdb_cover(name, t, system=system) - if data is not None: - if system == "games": - # IGDB only has cropped 3:4 PSP key art; composite - # it into the full PSP cover template. - data = compose_game_cover(data) - log.info("cover %r <- igdb", name) + # 2. Games/PS1: libretro (full box art) first, then the shipped + # OpenVGDB bundle (PSP only, offline), then ScreenScraper (non-quick), + # then Wikipedia (keyless, non-quick), then IGDB last. + data = _fetch_libretro(name, t, system=system, indexed_only=quick) + if data is not None: + log.info("cover %r <- libretro", name) + else: + data = None + if system == "games": + data = fetch_openvgdb_local(name) + if data is not None: + log.info("cover %r <- openvgdb", name) + if data is None and not quick and time.time() < deadline: + data = _fetch_screenscraper(name, t, system=system) + if data is not None: + log.info("cover %r <- screenscraper", name) + if data is None and not quick and time.time() < deadline: + data = _fetch_wikipedia_cover(name, t) + if data is not None: + log.info("cover %r <- wikipedia", name) + if data is None and time.time() < deadline: + data = _fetch_igdb_cover(name, t, system=system) + if data is not None: + if system == "games": + # IGDB only has cropped 3:4 PSP key art; composite it + # into the full PSP cover template (header + artwork). + data = compose_game_cover(data) + log.info("cover %r <- igdb", name) if data is None: _neg_cache[key] = time.time()