Skip to content

Conversation

@adamantike
Copy link
Contributor

Description
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.

Checklist

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

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.
@adamantike adamantike requested a review from gantoine September 9, 2025 03:23
@trunk-io
Copy link

trunk-io bot commented Sep 9, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

Test Results

675 tests  ±0   674 ✅ ±0   1m 13s ⏱️ -1s
  1 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 91e3dfb. ± Comparison against base commit 3af77cd.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
11596 7629 66% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
backend/endpoints/rom.py 44% 🟢
backend/handler/database/collections_handler.py 55% 🟢
backend/handler/database/roms_handler.py 52% 🟢
TOTAL 51% 🟢

updated for commit: 91e3dfb by action🐍

Copy link
Member

@gantoine gantoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great! 2 questions:

  • is the a migration needed for existing smart collections?
  • do you plan to also change the ui and filters to support multi-select? if not lmk and i can backlog it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants