Clear playlist if last item in list

This commit is contained in:
angelblue05 2018-01-09 21:03:32 -06:00
parent 900d94a22f
commit e530575d91
3 changed files with 22 additions and 10 deletions

View file

@ -413,14 +413,6 @@ class Player(xbmc.Player):
# Will be called when user stops xbmc playing a file
log.debug("ONPLAYBACK_STOPPED")
window('emby_customPlaylist.seektime', clear=True)
if self.currentFile in self.played_info:
log.info("Clear playlist.")
if self.played_info[self.currentFile]['Type'] == "Audio":
xbmc.PlayList(xbmc.PLAYLIST_MUSIC).clear()
else:
xbmc.PlayList(xbmc.PLAYLIST_VIDEO).clear()
self.stopAll()
@log_error()
@ -453,6 +445,14 @@ 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")