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

View file

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