Skip to content

Add tag filtering and custom filters - #862

Closed
priyanshuppal wants to merge 1 commit into
ruddarr:developfrom
priyanshuppal:custom-filters
Closed

priyanshuppal wants to merge 1 commit into
ruddarr:developfrom
priyanshuppal:custom-filters

Conversation

@priyanshuppal

Copy link
Copy Markdown

Adds tag filtering and custom filters to the Movies and Series grids. Custom filters work like the ones in the Radarr and Sonarr web interface.

What's new

  • Tag filter: a Tag picker in the filter menu, next to Root Folder.
  • Custom filters: the filter menu lists the server's custom filters (/api/v3/customfilter, type movieIndex for Radarr and series for Sonarr) together with filters saved on the device.
    • A selected filter combines with the preset filter, the folder and the tag; an item must match all of them.
    • Filters with conditions Ruddarr can't check are marked with a warning, and those conditions are kept untouched when the filter is saved.
  • Manage Filters sheet: create, edit, duplicate and delete filters. Each row shows a short summary of its conditions.
  • Condition builder:
    • Fields are grouped into Status, Library, Dates, Ratings and Metadata, and each field offers the operators and values the web interface does.
    • Section headers read as sentences, e.g. "Added in the last 30 days".
    • The editor shows a live "Matches N of M movies" count.
  • Saved in: server / This Device: saving to the server makes the filter show in the web interface. Moving a filter off the server asks for confirmation first.
  • Active filters: shown as chips above the grid. Each chip clears its own filter.

How matching works

CustomFilter.matches follows the web interface's client-side rules from the Radarr develop and Sonarr v4 frontends:

  • Conditions are combined with AND.
  • Array values mean "any of", or "all of" for the negative operators.
  • === is strict; string checks ignore case.
  • Relative and absolute dates are handled, and so are the per-key predicates, e.g. ratings ×10, episode progress, missing seasons and seasons monitored status.

Keys that need data the app doesn't decode yet are treated as unsupported:

  • Radarr: keywords, collection, release groups, file qualities, original title, release date and cutoff unmet.
  • Sonarr: release groups and the v5-only keys.

Notes

  • New code: the models are in Models/CustomFilters, the views in Views/Shared/CustomFilters. The Movies and Series views get small additions.
  • Tests: Tests/CustomFilterTests.swift covers decoding, round-trips, matching rules and dates. The Tests target compiles three model files, added as membership exceptions in the project file.
  • Preview data: custom-filters.json includes an unsupported filter and a filter of another type, which must be filtered out.
  • Localisation: new strings use String(localized:) / Text, but Localizable.xcstrings isn't updated yet. Building in Xcode will add them.
  • Changelog: CHANGELOG.md and WhatToTest have entries under Unreleased.

Testing

  • Tests: all 273 pass on macOS. SwiftLint is clean.
  • Simulator and Mac: checked with the mock API on iPhone 17 Pro and iPad Pro 11" simulators and on macOS: the menu, chips, Manage sheet, editor, saving to the device and the server, and unsupported filters.
  • Device: installed on an iPhone 15 Pro Max.

🤖 Generated with Claude Code

Movies and Series can be filtered by a single tag from the filter menu, and by
custom filters that work like the Radarr and Sonarr web interface's filters.

- Custom filters from the server (/api/v3/customfilter, "movieIndex" and
  "series") are imported, matched client-side with the web interface's rules,
  and listed in the filter menu. Filters with conditions Ruddarr can't check
  are marked and keep those conditions untouched when saved.
- Filters can be created and edited with a condition builder, and saved on the
  device or on the server, where the web interface shows them too.
- Active filters show as chips above the grid; each chip clears its filter.

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

Copy link
Copy Markdown
Collaborator

If you want to open a PR that's not 3000 added lines and a minimal implantation of just displaying filters that are read-only from *arr, I'll take a look at it.

@tillkruss tillkruss closed this Nov 11, 2026
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.

2 participants