Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALLOWED_FILTERS do not accept OPERATORS when using search #392

Closed
blacktwin opened this issue Oct 16, 2019 · 1 comment · Fixed by #693
Closed

ALLOWED_FILTERS do not accept OPERATORS when using search #392

blacktwin opened this issue Oct 16, 2019 · 1 comment · Fixed by #693

Comments

@blacktwin
Copy link
Collaborator

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?

@Hellowlol
Copy link
Collaborator

As close as you can get em ;)

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 a pull request may close this issue.

2 participants