Skip to content

Commit c3d2a56

Browse files
authored
Use totalSize attribute for watchlist walking (#1070)
1 parent b056e9d commit c3d2a56

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plexapi/myplex.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,11 @@ def watchlist(self, filter=None, sort=None, libtype=None, maxresults=9999999, **
864864
results += subresults[:maxresults - len(results)]
865865
params['X-Plex-Container-Start'] += params['X-Plex-Container-Size']
866866

867+
# totalSize is available in first response, update maxresults from it
868+
totalSize = utils.cast(int, data.attrib.get('totalSize'))
869+
if maxresults > totalSize:
870+
maxresults = totalSize
871+
867872
return self._toOnlineMetadata(results)
868873

869874
def onWatchlist(self, item):

0 commit comments

Comments
 (0)