Repository navigation
feat: support Sonarr and Radarr custom filters - #179
Merged
retransmit merged 6 commits intoOct 7, 2026
Merged
Conversation
- Fetch custom filters from /api/v3/customfilter in Sonarr and Radarr API clients - Add custom filter evaluators supporting Servarr operators (equal, notEqual, contains, notContains, greaterThan, lessThan, list comparisons, etc.) - Expose custom filter providers and integrate client-side filtering in filtered series and movies providers - Render custom filter chips in the Sort & Filter bottom sheet alongside standard filters with mutually exclusive selection - Add comprehensive unit test suites covering operators, edge cases, and custom filter evaluations for both Sonarr and Radarr
…d judges them
The evaluator now follows the series list's own filter rule for rule, so
that a custom filter shows the same series here as it does in Sonarr:
- the filter builder saves a rule's value as a list of alternatives. Each
is tested on its own and any one is enough, except under notEqual and
notContains, where none may match. The ordering tests and the starts and
ends tests looked at the first value alone
- the relative date rules ("in the last 30 days") are measured from now.
They fell through to an equality check that never matched. A series
with no such date passes none of the date rules, where "before" used to
let it through
- the keys Sonarr works a value out for are worked out the same way:
episode progress, rating as a percentage, rating votes, original
language, release groups, season count, missing season and seasons
monitored
- equal is exact, case included
- a rule that cannot be tested rejects the series: an unknown key, a row
left empty, or a property the server left out
SonarrSeries gains the properties those rules read: quality profile, root
folder, tags, scene numbering, ratings, original language, and the release
groups in its statistics.
The provider hands back only the filters saved for the series list, by
label as Sonarr's own menu orders them, so the sheet no longer sorts them
out itself.
The tests use rules in the shape the server sends them. The one on
episodeFileCount goes: Sonarr has no filter key of that name, and its own
page shows nothing for a rule on it.
…d judges them
The evaluator now follows the movie list's own filter rule for rule, so
that a custom filter shows the same movies here as it does in Radarr:
- the filter builder saves a rule's value as a list of alternatives. Each
is tested on its own and any one is enough, except under notEqual and
notContains, where none may match. The ordering tests and the starts and
ends tests looked at the first value alone
- the relative date rules ("in the next 6 months") are measured from now.
They fell through to an equality check that never matched. A movie with
no such date passes none of the date rules, where "before" used to let
it through
- the keys Radarr works a value out for are worked out the same way: the
collection by its title, original language, release groups, the
qualities of its files, size on disk from the statistics, and the TMDb,
IMDb, Rotten Tomatoes and Trakt ratings and votes
- equal is exact, case included
- a rule that cannot be tested rejects the movie: an unknown key, a row
left empty, or a property the server left out
RadarrMovie gains the properties those rules read: original title,
availability, minimum availability, quality profile, keywords, popularity,
tags, its statistics and the Trakt rating.
The provider hands back only the filters saved for the movie list
(movieIndex, or the movies section it belongs to), by label as Radarr's
own menu orders them, so the sheet no longer sorts them out itself.
The tests use rules in the shape the server sends them.
Owner
|
Thanks, putting the saved filters beside the built-in chips with one active at a time fits the sheet well. I pushed some changes to your branch, on top of your second commit: Fixes
Changed
Added
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for user-defined Sonarr and Radarr custom filters in the Movies and Series filter bottom sheets, resolving #177.
Changes
1. Data Models & API
service_radarr):RadarrCustomFiltermodel (id,type,label,filters) representing/api/v3/customfilter.getCustomFilters()toRadarrApi.radarrCustomFiltersProviderandradarrActiveCustomFilterProvider.service_sonarr):CustomFilterResourcemodel for/api/v3/customfilter.getCustomFilters()toSonarrApi.sonarrCustomFiltersProviderandsonarrActiveCustomFilterProvider.2. Custom Filter Evaluation Engine
matchesRadarrCustomFilterandmatchesSonarrCustomFiltersupporting:equal,notEqual,contains,notContains,greaterThan,greaterThanOrEqual,lessThan,lessThanOrEqual,startsWith,endsWith,in,notIn.[0],[2020],["English"]) as returned by the Servarr custom filter APIs.hasFile,episodeFileCount,episodeCount,missing), monitoring status (monitored), status (status), year (year), genres (genres), size on disk (sizeOnDisk), tags, and quality profiles.ANDrules matching web UI behavior.3. UI Integration
MoviesTab(_SortFilterBottomSheet) andSeriesTab(_SortFilterBottomSheet):Screenshots
Radarr Custom Filters
Sonarr Custom Filters
Verification
services/service_radarr/test/radarr_custom_filter_test.dart: 7 tests verifying operator logic, multi-rule evaluation, array-wrapped API values, and edge cases.services/service_sonarr/test/sonarr_custom_filter_test.dart: 7 tests verifying operator logic, series properties, array-wrapped API values, and edge cases.flutter test services/service_radarr,flutter test services/service_sonarr).dart analyze services/service_radarr services/service_sonarrreported 0 issues).Pixel_7_API_35).Closes #177