diff --git a/README.md b/README.md index cd8a974..d7591f8 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ Discs are matched by hash first (most precise), then serial, then filename. - `data/ps1_templates/` — optional PS1 Classics art templates (`ICON0.PNG` case frame, `PIC1.PNG` launch background); the app falls back to drawn art when they're absent. +- `data/nps/` — NoPayStation TSV lists (cached here on first store scan; drop + `PSP_GAMES.tsv` / `PSX_GAMES.tsv` manually to work offline). - State dir (`~/.local/state/psp-preserve/` by default, or `$XDG_STATE_HOME/psp-preserve`): - `library.sqlite` — the catalog + library database. - `covers/` — downloaded cover cache. @@ -282,7 +284,8 @@ Requirements & behaviour: writes `PSX//EBOOT.PBP`. Both then show up in the **Library** (PS1 Classics under **PS1**, PSP games under **Games**) and can be copied to the PSP like any other item. -4. The TSV lists are cached in the state dir and refreshed on each store scan. +4. The TSV lists are cached in `data/nps/` and refreshed on each store scan + (drop the `.tsv` files there manually to work offline). > **DRM note:** NPS content is PSN-DRM'd. To *run* it on the PSP you need the > [`npdrm_free`](https://github.com/qwikrazor87/npdrm_free) plugin (ARK and most diff --git a/app/nopaystation.py b/app/nopaystation.py index eca545a..6ba924f 100644 --- a/app/nopaystation.py +++ b/app/nopaystation.py @@ -36,8 +36,8 @@ def tsv_url(content_type: str, base: str = "") -> str: return f"{base}/{_TSV_NAMES.get(content_type, _TSV_NAMES['psp'])}" -def _cache_dir() -> Path: - d = config.STATE_DIR / "nps" +def _tsv_dir() -> Path: + d = config.DATA_DIR / "nps" d.mkdir(parents=True, exist_ok=True) return d @@ -110,7 +110,7 @@ def fetch_items(content_type: str, url: str = "", timeout: int = 60) -> List[dic """Download (and cache) a TSV, returning parsed item dicts.""" url = url or tsv_url(content_type) name = _TSV_NAMES.get(content_type, "PSP_GAMES.tsv") - cache = _cache_dir() / name + cache = _tsv_dir() / name if cache.is_file(): try: return parse_tsv(cache.read_text(encoding="utf-8", errors="replace"), content_type) diff --git a/data/nps/README.md b/data/nps/README.md new file mode 100644 index 0000000..2778760 --- /dev/null +++ b/data/nps/README.md @@ -0,0 +1,2 @@ +# NoPayStation TSV lists are cached here (downloaded on first store scan). +# You can also drop PSP_GAMES.tsv / PSX_GAMES.tsv here manually to work offline.