- Use CollectionSchema instead of ReturnType<typeof collectionsStore.getCollection>
in AddRoms.vue and RemoveRoms.vue (simpler, per gantoine review)
- Wrap bulk INSERT in a savepoint so a concurrent duplicate-key violation
is caught via IntegrityError and ignored rather than aborting the transaction
- Only bump Collection.updated_at in remove_roms_from_collection when rows
were actually deleted (rowcount > 0), matching add_roms_to_collection behavior
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace full rom_ids list replacement with atomic POST/DELETE endpoints
that add or remove individual ROMs from a collection. This prevents
concurrent rapid clicks from overwriting each other (last-write-wins).
Also fix missing session.flush() in add_rom_user() and add collection
endpoint tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This change converts the existing single-value ROM filter parameters
to support multiple values. Users can now filter ROMs by multiple genres,
franchises, collections, companies, age ratings, regions, and languages by
repeating the respective query parameters in API requests.
At the moment, setting multiple values for a filter will return ROMs
that match any of the provided values (logical OR). A future change can
introduce parameters like `genres_all (boolean)` to allow filtering ROMs
that match all specified values (logical AND).
The frontend has been updated to send single-value filters as arrays
to maintain compatibility with existing UI components. At the moment,
the UI does not support selecting multiple values, but this change
lays the groundwork for it.
NOTE: Breaking API change, as the filter parameters have changed names.
Fix `json_array_contains_value` function to use the `@>` operator for
checking if a JSON array contains a value in PostgreSQL. This is
necessary because the `has_key` function only works for string values.
Also, remove `get_rom_collections` method, as it was doing the same
thing as `get_collections_by_rom_id`.
Fixes#1441.