mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 06:04:15 +00:00
add searchProviders parameter to searchDiscover method (#1437)
* add searchProviders parameter to searchDiscover method * fix trailing whitespace * rename parameter
This commit is contained in:
parent
ec969a177c
commit
c7f4388137
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue