Skip to content

ALLOWED_FILTERS do not accept OPERATORS when using search #392

@blacktwin

Description

@blacktwin
music = plex.library.section("Music")
test = music.searchTracks(**{'track.skipCount': 1})
print(test) # results!

vs

music = plex.library.section("Music")
test = music.searchTracks(**{'track.skipCount__gte': 1})
print(test) # Unknown filter category: track.skipCount__gte

Appending the operator to the filter name for the used section works as intended.

# MusicSection / ALLOWED_FILTERS = (..., 'track.skipCount>>', ...)
music = plex.library.section("Music")
test = music.searchTracks(**{'track.skipCount>>': 1}) # equal or greater than
print(test) # intended results!

Seems like there may need to have an additional CUSTOM_FILTERS list for each library section class and have the ALLOWED_FILTERS for each libtype (grandparent, parent, child). CUSTOM_FILTERS would need to be able to have use of OPERATORS.

Plex uses exact matching for libtype filtering and allows for operators in custom filter of the library. How close should plex.search() be to Plex's WebUI ilibtype filters and custom filters?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions