Clear playlist if end is reached

This commit is contained in:
angelblue05 2018-01-09 22:30:05 -06:00
parent e530575d91
commit 68f959580b
2 changed files with 10 additions and 17 deletions

View file

@ -85,14 +85,6 @@ class PlaybackUtils(object):
index = max(self.playlist.getposition(), 0) + 1 # Can return -1
force_play = False
##### Track end of playlist
playlist_verify = playlist.Playlist().verify_playlist()
try:
if playlist_verify['result']['limits']['end'] >= index:
window('emby.playlist_end', value="true")
except Exception:
pass
# Stack: [(url, listitem), (url, ...), ...]
self.stack[0][1].setPath(self.stack[0][0])
try:

View file

@ -425,7 +425,7 @@ class Player(xbmc.Player):
def stopAll(self):
if not self.played_info:
return
return
log.info("Played_information: %s" % self.played_info)
# Process each items
@ -445,14 +445,6 @@ class Player(xbmc.Player):
media_type = data['Type']
playMethod = data['playmethod']
if window('emby.playlist_end', value="true"):
window('emby.playlist_end', clear=True)
if media_type == "Audio":
xbmc.PlayList(xbmc.PLAYLIST_MUSIC).clear()
else:
xbmc.PlayList(xbmc.PLAYLIST_VIDEO).clear()
# Prevent manually mark as watched in Kodi monitor
window('emby_skipWatched%s' % itemid, value="true")
@ -498,6 +490,15 @@ class Player(xbmc.Player):
window('emby.external_check', clear=True)
##### Track end of playlist
if media_type == "Audio":
playlist = xbmc.PlayList(xbmc.PLAYLIST_MUSIC)
else:
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
if playlist.getposition < 0:
playlist.clear()
# Stop transcoding
if playMethod == "Transcode":
log.info("Transcoding for %s terminated." % itemid)