From 5841128729acdabad0d466246a96ee5ea75612bd Mon Sep 17 00:00:00 2001 From: RyanClark123 Date: Thu, 26 Sep 2024 09:59:11 +0100 Subject: [PATCH] Amend get_next Amend the get_next function which calls /Shows/NextUp to include an optional seriesid and userid parameter --- jellyfin_apiclient_python/api.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/jellyfin_apiclient_python/api.py b/jellyfin_apiclient_python/api.py index 1328b56..f3c17bf 100644 --- a/jellyfin_apiclient_python/api.py +++ b/jellyfin_apiclient_python/api.py @@ -343,13 +343,16 @@ def get_recently_added(self, media=None, parent_id=None, limit=20): 'Fields': info() }) - def get_next(self, index=None, limit=1): - return self.shows("/NextUp", { - 'Limit': limit, - 'UserId': "{UserId}", - 'StartIndex': None if index is None else int(index) - }) - + def get_next(self, userId=None, index=None, limit=1, seriesId=None): + return self.shows( + '/NextUp', + { + 'Limit': limit, + 'UserId': '{UserId}' if userId is None else userId, + 'StartIndex': None if index is None else int(index), + 'SeriesId': None if seriesId is None else seriesId, + }, + ) def get_adjacent_episodes(self, show_id, item_id): return self.shows("/%s/Episodes" % show_id, { 'UserId': "{UserId}",