Show theme/DLC names and embedded theme previews in the library
This commit is contained in:
@@ -506,6 +506,18 @@ class NoPayStationSource(Source):
|
||||
kind_hint = self.content_type if self.content_type in ("theme", "dlc") else None
|
||||
folder = nopaystation.extract_pkg(pkg, title_id, dest_dir, pkg2zip,
|
||||
kind_hint, progress_cb, cancel_event)
|
||||
if self.content_type in ("theme", "dlc"):
|
||||
_write_sidecar(folder, item)
|
||||
return folder
|
||||
finally:
|
||||
shutil.rmtree(tmp, ignore_errors=True)
|
||||
|
||||
|
||||
def _write_sidecar(folder, item):
|
||||
"""Save the store display name beside a downloaded theme/DLC (for the library)."""
|
||||
try:
|
||||
meta = {"name": item.get("name") or "", "title_id": item.get("title_id") or "",
|
||||
"content_id": item.get("content_id") or ""}
|
||||
(Path(folder) / "meta.json").write_text(json.dumps(meta, ensure_ascii=False), encoding="utf-8")
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user