Skip to content

search **kwargs with also != > < #320

Closed

Description

@hidaba

Hello,
is it possible add the search not only for = but also for > or != or < ?

example:
music = plex.library.section('Musica')
for musica in music.search(title=None, sort=None, maxresults=99999, libtype="album",genre != 'Pop') : #not

for musica in music.search(title=None, sort=None, maxresults=99999, libtype="album",genre = 'Pop') : #contain

for musica in music.search(title=None, sort=None, maxresults=99999, libtype="album",genre == 'Pop') : # equal

for musica in music.search(title=None, sort=None, maxresults=99999, libtype="album",year > 1970) : # major

Activity

  1. worried-networking commented on Nov 26, 2018

    @worried-networking
    Contributor

    As for != you can use something like search(title=None, **{'year!': 2000}) (not the most convenient way, but at least this), others aren't supported, afaik.

  2. Hellowlol commented on Nov 26, 2018

    @Hellowlol
    Collaborator

    We should add more filters so we can lean more on pms for searching.

    You also have fetchitems where you can use all kinds for operators

  3. Hellowlol commented on Nov 26, 2018

    @Hellowlol
    Collaborator

    The easiest way would be to use

    all_pop_before_70 = music.all(genre__exact='pop', year__lte=1970)
    

    see https://python-plexapi.readthedocs.io/en/latest/modules/base.html#plexapi.base.PlexObject.fetchItem more stuff.

  4. blacktwin commented on Jan 24, 2020

    @blacktwin
    Collaborator

    We should add more filters so we can lean more on pms for searching.

    From #392 some of the filters that PMS uses are not able to be used with plexapi for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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