apply limit to OnDeck if OnDeckTVextended not set

This commit is contained in:
dettwild 2017-02-02 20:31:58 +01:00
parent a782075236
commit 93509666d7

View file

@ -754,6 +754,7 @@ def getOnDeck(viewid, mediatype, tagname, limit):
if xml in (None, 401): if xml in (None, 401):
log.error('Could not download PMS xml for view %s' % viewid) log.error('Could not download PMS xml for view %s' % viewid)
return xbmcplugin.endOfDirectory(HANDLE) return xbmcplugin.endOfDirectory(HANDLE)
limitcounter = 0
for item in xml: for item in xml:
api = API(item) api = API(item)
listitem = api.CreateListItemFromPlexItem( listitem = api.CreateListItemFromPlexItem(
@ -775,6 +776,9 @@ def getOnDeck(viewid, mediatype, tagname, limit):
handle=HANDLE, handle=HANDLE,
url=url, url=url,
listitem=listitem) listitem=listitem)
limitcounter += 1
if limitcounter == limit:
break
return xbmcplugin.endOfDirectory( return xbmcplugin.endOfDirectory(
handle=HANDLE, handle=HANDLE,
cacheToDisc=settings('enableTextureCache') == 'true') cacheToDisc=settings('enableTextureCache') == 'true')