mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 01:58:41 +01:00
Merge 0123/0124/0125 into one migration. Each added STORED generated columns to `roms`, and 0125 already dropped and re-added several, so upgrading rewrote the widest table three times and restated the `roms_metadata` view three times. One ALTER TABLE now carries the Steam rebuild, the three IGDB tag columns and the rating count, and the view is recreated once. Verified upgrade/downgrade/upgrade on MariaDB and Postgres. Score each unordered pair once. Candidate generation is symmetric, so every pair had its dot product computed twice. The sweep now runs in ascending id order and scores only from the lower id, which also makes a ROM's edges final the moment the sweep passes it, so the incremental flush survives. Only the target's quality bonus differs by direction, so one content score is blended twice. The per-ROM candidate ceiling moves into `candidate_ids`, taking the rarest posting lists first, where it bounds work instead of being applied after the cost was already paid. Read identity off one list. `sibling_roms` decides "same title" from seven provider ids; the suppression here used two, so a pair matched only by MobyGames was a sibling everywhere else in RomM and a recommendation for itself here. `IDENTITY_ID_FIELDS` on the model is now the one home, consumed unscoped by the builder since a reissue on other hardware is no more a suggestion than a second copy on the same platform. Make the facet vocabulary a StrEnum. It was spelled out in five places, two of them already stale, and `facet: str` kept it out of the API contract, so an unmapped facet silently rendered a raw value. It reaches OpenAPI as a closed union and the frontend maps are keyed by it, so adding a facet now fails the typecheck until the UI handles it. Give each surface one serving entry point. `similar_roms` and `recommended_roms` own the over-fetch, hydration, visibility filter, series cap and cache that the two endpoints and the inspection tool each re-implemented with three different over-fetch constants; the cache moves in with them so no caller can rank a feed without populating it. Endpoints now do ORM-to-schema only. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>