Skip to content

feat(api): add scene_filter parameter to findDuplicateScenes#6884

Open
slick-daddy wants to merge 9 commits intostashapp:developfrom
slick-daddy:exclude-dedup
Open

feat(api): add scene_filter parameter to findDuplicateScenes#6884
slick-daddy wants to merge 9 commits intostashapp:developfrom
slick-daddy:exclude-dedup

Conversation

@slick-daddy
Copy link
Copy Markdown
Contributor

Description

Closes #3573

Adds scene_filter parameter support to the findDuplicateScenes query, allowing users to exclude specific scenes from duplicate checking results.

For example, a user can now filter out scenes by path, tag, or any other supported scene filter criteria. This means scenes they intentionally want to keep (e.g. deepfakes, alternate versions) will no longer appear as unwanted noise in the duplicate checker.

Changes

  • Schema: Added optional scene_filter argument to findDuplicateScenes
  • Backend: Updated SceneReaderWriter interface and mock to accept a SceneFilterType
  • API: Passes the scene filter from the resolver down to the duplicate checking repository
  • SQLite: FindDuplicates query is now dynamically built based on the provided filter
  • Tests: Updated SQLite-level duplicate checking tests to cover filtered queries

Note: This PR implements the backend and GraphQL API only.
Frontend integration (adding filter UI to the duplicate checker) is not included.

Expands the findDuplicateScenes query to accept a full SceneFilterType. This enables filtering out specific directories or tags from the duplication matching process.
Modifies the FindDuplicates signature to take a SceneFilterType pointer, allowing the underlying repository to filter the pool of scenes before duplicate checking.
Updates the mock definition to match the new FindDuplicates method signature.
Modifies the FindDuplicateScenes GraphQL resolver to pass the newly added scene_filter schema argument into the database repository layer.
Refactors the FindDuplicates implementation to use the internal qb.makeQuery tool instead of static raw SQL. This enables the duplicate checker to utilize the provided SceneFilterType, natively supporting advanced filtering like path exclusions.
Updates the unit tests to pass a nil scene filter, matching the new FindDuplicates method signature.
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.

Exclude directories in scene duplicate checker

1 participant