psp: detect installed PS1 games (incl. Category Lite folders)

PS1 EBOOTs install as PSP/GAME/{category}/{GAME_ID}/EBOOT.PBP, which the
PSP index ignored (it only indexed ISO games/videos), so the app never
marked them 'on PSP'. Index homebrew EBOOTs by folder id + embedded title,
match PS1 library items against them, and make 'Delete from PSP' remove the
whole game folder.
This commit is contained in:
2026-09-07 19:59:30 -04:00
parent 0ebd173af7
commit 2c6b07e286
2 changed files with 65 additions and 4 deletions
+19 -3
View File
@@ -236,8 +236,11 @@ def list_installed(root):
def build_index(inventory):
"""Build a lookup index for matching library discs against the PSP.
Returns ``{"raw": set, "names": set}`` where ``raw`` holds lowercase ISO
stems (exact filename match) and ``names`` holds fuzzy-normalized stems.
Returns ``{"raw", "names", "homebrew_ids", "homebrew_names"}`` where
``raw`` holds lowercase ISO stems (exact filename match), ``names`` holds
fuzzy-normalized stems, and the homebrew keys index ``PSP/GAME/**/EBOOT.PBP``
(homebrew + PS1 Classics, including Category Lite subfolders) by folder id
and embedded title.
"""
raw, names = set(), set()
for group in ("games", "videos"):
@@ -247,7 +250,20 @@ def build_index(inventory):
norm = matcher.normalize_name(stem)
if norm:
names.add(norm)
return {"raw": raw, "names": names}
hb_ids, hb_names = set(), set()
for it in (inventory or {}).get("homebrew", []):
ident = str(it.get("id") or "").strip().lower()
if ident:
hb_ids.add(ident)
stem = Path(it.get("name") or "").stem.strip().lower()
if stem:
hb_names.add(stem)
norm = matcher.normalize_name(Path(it.get("name") or "").stem)
if norm:
hb_names.add(norm)
return {"raw": raw, "names": names,
"homebrew_ids": hb_ids, "homebrew_names": hb_names}
def find_umd_iso(root):