Keep the titles a store cannot install

`select_games` answers what a store can install and throws the rest away, which is fine
for installing and wrong for showing: a client that hides what it cannot install leaves
the visitor wondering whether the catalog is small or their machine is unusual.

`survey_catalog` is the same walk with those titles kept — one record per title, with a
reason code (platform_off, host_asset, no_asset, vetoed), a sentence, and enough of the
catalog entry to draw a card. `select_games` is now a two-value wrapper around it, so an
adapter that only installs needs no change; the Batocera and RetroArch stores are
untouched.

Titles the store *chooses* not to offer stay invisible: the wrong status or an
only/exclude list is editorial, not a limitation of the machine. A platform switched off
is reported, because to somebody reading a catalog it says "not supported here".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-18 19:45:09 +02:00
co-authored by Claude Opus 5
parent 10f7e88434
commit 9c185e8fa9
2 changed files with 87 additions and 10 deletions
+26 -1
View File
@@ -54,6 +54,31 @@ games, skipped = ws.select_games(cfg, ws.fetch_catalog(cfg, use_cache=True), acc
playlist. It is what `state.json` is keyed by (`<scope>:<name>`), so two hosts
can carry a game of the same name without colliding.
### Listing what cannot be installed
`select_games` answers what a store can install. `survey_catalog` answers the same
question and keeps the rest, which is what a client needs to show a catalog honestly:
```python
games, skipped, unavailable = ws.survey_catalog(cfg, catalog, accept)
```
Each `unavailable` record carries `name`, `title`, `platform`, `desc`, `author`,
`image_url`, the latest `version`, a `reason` code and a `detail` sentence. The codes:
| Code | Meaning |
|---|---|
| `platform_off` | this store does not carry that platform at all |
| `host_asset` | the platform has no asset kind for this OS and architecture |
| `no_asset` | no release carries the asset it would need |
| `vetoed` | the adapter's `accept` refused it |
Titles the store *chooses* not to offer — the wrong status, an `only`/`exclude` list —
are in none of the three lists: that is editorial, not a limitation of the machine. A
platform switched off is reported, because to somebody looking at a catalog it reads as
"not supported here". `select_games` is now a two-value wrapper around this, so an
adapter that only installs needs no change.
## What is in here
| Area | Functions |
@@ -64,7 +89,7 @@ can carry a game of the same name without colliding.
| Store home | `init`, then `HOME`, `CONFIG_PATH`, `STATE_PATH`, `CATALOG_CACHE` |
| HTTP | `http_get`, `http_download`, `api_url`, `download_url`, `user_agent` |
| Host | `machine`, `host_os`, `host`, `resolve_for_host` |
| Catalog | `fetch_catalog`, `select_games`, `pick_release`, `asset_basename`, `download_image` |
| Catalog | `fetch_catalog`, `select_games`, `survey_catalog`, `pick_release`, `asset_basename`, `download_image` |
| State | `load_state`, `save_state`, `game_key`, `record_scope`, `records_by_scope`, `match_keys`, `limit_to_names` |
Four of them carry decisions worth knowing about.