Fix endless trailer loop

This commit is contained in:
tomkat83 2016-04-11 17:50:56 +02:00
parent 7f956c6f18
commit c20c701abd
2 changed files with 5 additions and 8 deletions

View file

@ -60,8 +60,8 @@ class PlaybackUtils():
if not playurl:
return xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, listitem)
if dbid is None or dbid == '999999999':
# Item is not in Kodi database
if dbid in (None, '999999999'):
# Item is not in Kodi database or is a trailer
playmethod = window('emby_%s.playmethod' % playurl)
if playmethod == "Transcode":
window('emby_%s.playmethod' % playurl, clear=True)
@ -144,10 +144,8 @@ class PlaybackUtils():
if len(item[0][0]) > 1:
# Only add to the playlist after intros have played
for counter, part in enumerate(item[0][0]):
# Playlist items don't fail on their first call - skip them
# here, otherwise we'll get two 1st parts
if (counter == 0 and
window('emby_customPlaylist') == "true"):
# Never add first part
if counter == 0:
continue
# Set listitem and properties for each additional parts
API.setPartNumber(counter)
@ -213,7 +211,7 @@ class PlaybackUtils():
added
"""
# Failure when downloading trailer playQueue
if xml is None:
if xml in (None, 401):
return False
# Failure when getting trailers, e.g. when no plex pass
if xml.attrib.get('size') == '1':

View file

@ -454,7 +454,6 @@ class Player(xbmc.Player):
window('Plex_currently_playing_itemid', clear=True)
window('emby_customPlaylist', clear=True)
window('emby_customPlaylist.seektime', clear=True)
window('emby_playbackProps', clear=True)
window('emby_customPlaylist.seektime', clear=True)
log("Clear playlist properties.", 1)