parent
a9fb2e127e
commit
c6ba6b42a8
1 changed files with 15 additions and 6 deletions
|
@ -593,6 +593,12 @@ def getOnDeck(viewid, mediatype, tagname, limit):
|
||||||
{'operator': "is", 'field': "tag", 'value': "%s" % tagname}
|
{'operator': "is", 'field': "tag", 'value': "%s" % tagname}
|
||||||
]}
|
]}
|
||||||
}
|
}
|
||||||
|
items = js.get_tv_shows(params)
|
||||||
|
if not items:
|
||||||
|
# Now items retrieved - empty directory
|
||||||
|
xbmcplugin.endOfDirectory(handle=HANDLE)
|
||||||
|
return
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
'sort': {'method': "episode"},
|
'sort': {'method': "episode"},
|
||||||
'limits': {"end": 1},
|
'limits': {"end": 1},
|
||||||
|
@ -617,6 +623,7 @@ def getOnDeck(viewid, mediatype, tagname, limit):
|
||||||
{'operator': "true", 'field': "inprogress", 'value': ""}
|
{'operator': "true", 'field': "inprogress", 'value': ""}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Are there any episodes still in progress/not yet finished watching?!?
|
# Are there any episodes still in progress/not yet finished watching?!?
|
||||||
# Then we should show this episode, NOT the "next up"
|
# Then we should show this episode, NOT the "next up"
|
||||||
inprog_params = {
|
inprog_params = {
|
||||||
|
@ -626,23 +633,25 @@ def getOnDeck(viewid, mediatype, tagname, limit):
|
||||||
}
|
}
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
for item in js.get_tv_shows(params):
|
for item in items:
|
||||||
inprog_params['tvshowid'] = item['tvshowid']
|
inprog_params['tvshowid'] = item['tvshowid']
|
||||||
episodes = js.get_episodes(inprog_params)
|
episodes = js.get_episodes(inprog_params)
|
||||||
if not episodes:
|
if not episodes:
|
||||||
# No, there are no episodes not yet finished. Get "next up"
|
# No, there are no episodes not yet finished. Get "next up"
|
||||||
params['tvshowid'] = item['tvshowid']
|
params['tvshowid'] = item['tvshowid']
|
||||||
episodes = js.get_episodes(params)
|
episodes = js.get_episodes(params)
|
||||||
|
if not episodes:
|
||||||
|
# Also no episodes currently coming up
|
||||||
|
continue
|
||||||
for episode in episodes:
|
for episode in episodes:
|
||||||
# There will always be only 1 episode ('limit=1')
|
# There will always be only 1 episode ('limit=1')
|
||||||
listitem = createListItem(episode,
|
listitem = createListItem(episode,
|
||||||
appendShowTitle=appendShowTitle,
|
appendShowTitle=appendShowTitle,
|
||||||
appendSxxExx=appendSxxExx)
|
appendSxxExx=appendSxxExx)
|
||||||
xbmcplugin.addDirectoryItem(
|
xbmcplugin.addDirectoryItem(handle=HANDLE,
|
||||||
handle=HANDLE,
|
url=episode['file'],
|
||||||
url=episode['file'],
|
listitem=listitem,
|
||||||
listitem=listitem,
|
isFolder=False)
|
||||||
isFolder=False)
|
|
||||||
count += 1
|
count += 1
|
||||||
if count >= limit:
|
if count >= limit:
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue