Skip to content

add searchProviders parameter to searchDiscover method #1437

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

Merged
merged 3 commits into from
Jul 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion plexapi/myplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,14 +1049,17 @@ def markUnplayed(self, item):
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.

Parameters:
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')
Expand All @@ -1068,6 +1071,7 @@ def searchDiscover(self, query, limit=30, libtype=None):
'query': query,
'limit': limit,
'searchTypes': libtype,
'searchProviders': providers,
'includeMetadata': 1
}

Expand Down