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

Search Improvements #598

Closed
wants to merge 14 commits into from
Closed

Search Improvements #598

wants to merge 14 commits into from

Conversation

blacktwin
Copy link
Collaborator

@blacktwin blacktwin commented Nov 8, 2020

Description

Improving the functionality of librar.search() to work more inline with Plex's webUI.
Searching now allows the libtype.category searching found in libraries that have grandparent, parent, and child structures.
Searching now allows for the use of operators (>>, <<, !, <, >)

Addresses issues #392, #320, #595

Newly supported searches:

plex.library.section('Movies').search(**{'genre':'Romance'})
plex.library.section('Movies').search(**{'genre!':'Romance'})
plex.library.section('Movies').search(**{'year>>':'2000'})
plex.library.section('Movies').search(**{'year<<':'2000'})
plex.library.section('TV Shows').search(**{'show.year<<':'2000'})
plex.library.section('TV Shows').search(**{'episode.year<<':'2000'})

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have added tests when applicable

allow for libtype.categoryOperator searching (episode.viewCount>>2)
allow for categoryOperator searching (viewCount>>2)
test for available operators for used category
test for booleanFilters values to be str or int variants of 1 or 0
@blacktwin blacktwin marked this pull request as draft November 8, 2020 04:59
@blacktwin
Copy link
Collaborator Author

Draft until I can add some tests. Tests should include comparing library searching against inverse searching found in #595.

addresses #622 in the case of searching for a "libType.filter" like "show.label" libCategory would be the filter "label"
if the search kwarg is not "libType.filter" and just "filter" libCategory is the filter
@blacktwin
Copy link
Collaborator Author

Just some examples of what will work now with the current state of this PR:

library = plex.library.section('TV Shows')
library.search(unwatchedLeaves=True)                     # resolves to search show.unwatchedLeaves
library.searchShows(unwatched=True)                      # resolves to search episode.unwatched
library.search(unwatched=True)                           # resolves to search episode.unwatched
library.search(**{'episode.unwatchedLeaves':True})       # resolves to episode.unwatchedLeaves and errors as this pairing does not exist

Adding additional checks for libtype.category in kwargs or using searchLibtype
Attempt to resolve to the correct pairing of libtype.category
Provide detail messaging when a category exists in multiple libtypes in the library
@meisnate12
Copy link
Contributor

any update to when this might get finished? Not trying to rush you just got curious when i saw it still wasn't in the latest release

fix confirmed working in previous stable version
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