add searchProviders parameter to searchDiscover method (#1437)

* add searchProviders parameter to searchDiscover method

* fix trailing whitespace

* rename parameter
This commit is contained in:
Mike Di Nicola 2024-07-06 13:00:38 -04:00 committed by GitHub
parent ec969a177c
commit c7f4388137
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1049,7 +1049,7 @@ class MyPlexAccount(PlexObject):
self.query(key, params=params)
return self
def searchDiscover(self, query, limit=30, libtype=None):
def searchDiscover(self, query, limit=30, libtype=None, providers='discover'):
""" Search for movies and TV shows in Discover.
Returns a list of :class:`~plexapi.video.Movie` and :class:`~plexapi.video.Show` objects.
@ -1057,6 +1057,9 @@ class MyPlexAccount(PlexObject):
query (str): Search query.
limit (int, optional): Limit to the specified number of results. Default 30.
libtype (str, optional): 'movie' or 'show' to only return movies or shows, otherwise return all items.
providers (str, optional): 'discover' for default behavior
or 'discover,PLEXAVOD' to also include the Plex ad-suported video service
or 'discover,PLEXAVOD,PLEXTVOD' to also include the Plex video rental service
"""
libtypes = {'movie': 'movies', 'show': 'tv'}
libtype = libtypes.get(libtype, 'movies,tv')
@ -1068,6 +1071,7 @@ class MyPlexAccount(PlexObject):
'query': query,
'limit': limit,
'searchTypes': libtype,
'searchProviders': providers,
'includeMetadata': 1
}