Files
romm/backend/tests/models
Ryan Farthing 4229c45e0b fix(collections): drop hidden roms' covers from collection responses (#5311)
* fix(collections): drop hidden roms' covers from collection responses

_hide_collection_roms already strips roms hidden from the caller out of
rom_ids (and so rom_count), but left path_covers_small/path_covers_large
alone. The collection card builds its thumbnail from those, so a hidden
rom's cover art still showed on regular, smart and virtual collections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(collections): hide hidden roms in collection write responses (pr-ready: code-review)

Run the write endpoints' responses through _hide_collection_roms so a hidden
rom's id and cover don't come back from add/remove/update calls. Trim the
docstring and reuse the cover test helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(collections): match hidden covers by rom id (pr-ready: simplify)

Cover URLs under roms/{platform_id}/{rom_id}/ carry the rom id, so filter on it
instead of looking up each hidden rom's current cover path. This drops the extra
query and get_cover_paths, and also catches stale smart collection snapshots.
Add a single-schema _hide_collection_rom wrapper for the per-item endpoints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(collections): name the single-schema hide helper (pr-ready: review-polish)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(collections): keep hidden members on update and refuse hidden adds

PUT /collections/{id} replaced the member list with what the client sent, so a
restricted owner saving the filtered list silently dropped roms hidden from
them. Keep those members, and treat hidden roms like missing ones when adding
through PUT or POST /collections/{id}/roms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
2026-10-29 08:49:07 -04:00
..