diff --git a/resources/lib/playbackutils.py b/resources/lib/playbackutils.py index 94d95d0e..ca434dde 100644 --- a/resources/lib/playbackutils.py +++ b/resources/lib/playbackutils.py @@ -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: diff --git a/resources/lib/player.py b/resources/lib/player.py index dd3838c8..9c37c1bb 100644 --- a/resources/lib/player.py +++ b/resources/lib/player.py @@ -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)