PSP Sync: show friendly theme/DLC names instead of raw filenames
This commit is contained in:
+12
-3
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user