Fix DLC switch freeze: skip bulk cover scraping for themes/DLC

This commit is contained in:
2026-09-08 23:55:51 -04:00
parent 318a920873
commit e01013ce6a
2 changed files with 10 additions and 4 deletions
+4 -1
View File
@@ -411,6 +411,9 @@ def _fetch_libretro(name, timeout, system="games", indexed_only=False):
data = fetch_libretro_local(name) data = fetch_libretro_local(name)
if data is not None: if data is not None:
return data return data
# Theme/DLC share the PSP thumbnails repo, so reuse the games index instead
# of downloading a duplicate copy of the same tree under a new system key.
idx_system = system if system in _PLATFORMS else "games"
if not indexed_only: if not indexed_only:
# 1. Cheap: exact + progressively stripped names (no index needed). # 1. Cheap: exact + progressively stripped names (no index needed).
for kind in _LIBRETRO_KINDS: for kind in _LIBRETRO_KINDS:
@@ -421,7 +424,7 @@ def _fetch_libretro(name, timeout, system="games", indexed_only=False):
# 2. Fuzzy/exact via the precomputed index (covers exact names too, so the # 2. Fuzzy/exact via the precomputed index (covers exact names too, so the
# bulk loader skips the wasteful exact pass entirely). # bulk loader skips the wasteful exact pass entirely).
for kind in _LIBRETRO_KINDS: for kind in _LIBRETRO_KINDS:
best = _index_best(name, kind, system) best = _index_best(name, kind, idx_system)
if best: if best:
data = _fetch_png(best, kind, timeout, system) data = _fetch_png(best, kind, timeout, system)
if data is not None: if data is not None:
+6 -3
View File
@@ -2040,7 +2040,10 @@ class StorePage(QWidget):
p = covers.cover_path(rid, system) p = covers.cover_path(rid, system)
if p.exists() and covers.file_is_image(p): if p.exists() and covers.file_is_image(p):
item.setIcon(QIcon(_fit_pixmap(QPixmap(str(p)), self.ICON_W, self.ICON_H))) item.setIcon(QIcon(_fit_pixmap(QPixmap(str(p)), self.ICON_W, self.ICON_H)))
elif rid not in self._cover_attempted: elif system not in ("theme", "dlc") and rid not in self._cover_attempted:
# Themes and DLC have no meaningful box art in libretro/IGDB, and
# bulk-scraping hundreds of them on every switch to the DLC list
# saturates the network/CPU and makes the store unresponsive.
self._cover_attempted.add(rid) self._cover_attempted.add(rid)
self._cover_queue.append((row, { self._cover_queue.append((row, {
"name": covers.plain_title(it["name"]) or it["name"], "name": covers.plain_title(it["name"]) or it["name"],
@@ -2287,9 +2290,9 @@ class StorePage(QWidget):
meta = dlg.selected_meta meta = dlg.selected_meta
if meta: if meta:
title = meta.get("title") or None title = meta.get("title") or None
info.save(str(rid), "games", meta, manual=True, title=title) info.save(str(rid), system, meta, manual=True, title=title)
it["title_override"] = title or None it["title_override"] = title or None
self._refresh_item_cover(it, rid, "games") self._refresh_item_cover(it, rid, system)
def _refresh_item_cover(self, it, rid, system): def _refresh_item_cover(self, it, rid, system):
p = covers.cover_path(rid, system) p = covers.cover_path(rid, system)