PSP Sync: show friendly theme/DLC names instead of raw filenames

This commit is contained in:
2026-09-08 22:51:36 -04:00
parent 46c675ce79
commit 62ce4b1913
2 changed files with 27 additions and 11 deletions
+12 -3
View File
@@ -222,7 +222,7 @@ def _pkg_items(root):
def _theme_items(root):
"""Installed themes (``PSP/THEME/*.ptf``)."""
"""Installed themes (``PSP/THEME/*.ptf``), named from the PTF header."""
items = []
theme_dir = root / "PSP" / "THEME"
if theme_dir.is_dir():
@@ -231,8 +231,17 @@ def _theme_items(root):
except OSError:
return items
for path in entries:
if path.is_file() and path.suffix.lower() == ".ptf":
items.append(_file_item(path, "theme"))
if not path.is_file() or path.suffix.lower() != ".ptf":
continue
item = _file_item(path, "theme")
try:
from . import theme as theme_mod
name = theme_mod.ptf_name(path)
except Exception: # noqa: BLE001
name = ""
if name:
item["name"] = name
items.append(item)
return items