The same 503 was built inline at seven sites across the metadata handlers, and
the previous commits added two more copies of it as per-handler `_unavailable`
helpers. `base_handler.unavailable(provider)` now builds it for all of them.
Also renames the search endpoint's cover filter to say what it does and types
the scan test's lookup factory.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A complete rescan clears the id of every source it consulted that came back
empty. That reads an outage as a conclusive miss for the providers that report
a failure as an empty match, so a rescan run while one was down wiped the id it
would otherwise have confirmed, hand-set ones included.
Each of those now reports the failure and leaves the tolerance to the caller,
which is what the gather loop's discard already assumed:
- Pouët, CSDb and Demozoo stop swallowing the 503 their own `_request` raises,
and Pouët's title search raises it rather than answering "no unique title".
- SteamGridDB and Flashpoint stop catching `Exception` around a whole lookup;
HLTB stops catching it around its search.
- ScreenScraper answers empty for every remaining ROM once its daily-quota or
credentials breaker trips, so the scan reads that state off the service and
drops it from the sources the rescan may clear.
SteamGridDB resolves outside the gather and so needs the discard at its call
site. Search keeps degrading to no thumbnail, since its cover art sits on top
of matches the other providers already produced.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both CI failures came from one import cycle. RQ could no longer resolve
`endpoints.sockets.scan.scan_platforms`, and the e2e seed script failed the
same way, because `sigil` imports the platform slug enum, importing anything
under `handler.metadata` runs its `__init__`, that reaches `gamelist_handler`
which imports `handler.filesystem`, and `roms_handler` there imports `sigil`
back while it is still half-initialised.
The cycle predates this branch. It stayed hidden because `scan.py` reached
the enum through `utils.switch`, imported late enough that
`handler.filesystem` was already loaded; naming the adapter directly moved
that import to the top of the module and the ordering luck ran out.
So the enum moves to `utils/platform_slugs.py`, which imports nothing but
`enum`. Naming a platform no longer drags in httpx, redis and the titledb
task, and the 29 call sites point at the module that owns it rather than
picking it up from a 1000-line metadata handler that happens to re-export
it. `import adapters.services.sigil` now also works on its own, which it
did not before.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Follow-up cleanup on the company metadata split.
- Hasheous returns `involved_companies` keyed by id, not as the list IGDB
itself returns, so iterating it yielded the dict's string keys and raised
on `c.get("publisher")`. Read it through the same pydash accessor the
sibling `companies` line uses, and cover both shapes with a test.
- ss/ra/flashpoint/gamelist bind the publisher and developer lists once and
build `companies` from them, so the merged list cannot drift from the
split it is meant to be the union of. Follows launchbox's existing shape.
- The exporters shared one copy of the "prefer the explicit field, fall back
to the companies ordering" rule; it now lives on `RomMetadata` as
`primary_developer` / `primary_publisher`.
- Migration 0112 gates its two backfills on a probe. No stored blob carries
the new keys before a re-scan, so they otherwise scan the whole roms table
twice, and rewrite every roms_facets row, to write nothing.
- Smart collections no longer claim a `selected_publisher` legacy key that
never shipped.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Metadata providers (ScreenScraper, RetroAchievements, LaunchBox,
Flashpoint, gamelist, IGDB) distinguish the publisher from the developer
of a game, but RomM amalgamated both into a single `companies` list at
ingestion, so the distinction was unrecoverable. This adds `publishers`
and `developers` as new, refined fields end to end while keeping
`companies` (the merged union) working exactly as before.
Backend:
- Handlers now emit publishers/developers alongside the unchanged
companies list; IGDB requests the involved_companies developer/
publisher flags to split by role.
- Migration 0112 adds generated_publishers/generated_developers columns
on roms, projects them through the roms_metadata view, mirrors them
into roms_facets, and adds publisher/developer virtual-collection
types (triggers/functions rebuilt for MariaDB/MySQL + PostgreSQL).
- Filters, facets, endpoints, smart collections and the gamelist/pegasus
exporters all carry the new fields; exporters prefer the explicit
split and fall back to the companies heuristic for un-rescanned ROMs.
Frontend (v2):
- Shared filter store + API service, gallery filter drawer, URL
persistence, game detail display (Developers/Publishers with a
Companies fallback), edit dialog, smart-collection criteria, and a
publisher/developer "group virtual collections by" option.
- Also relabels the confusing "company"->"Developer" group-by option
to "Company" now that a proper Developer option exists.
Fixes#3518
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>