From 91b35cba12d12aaaa64b811540d380250c9a8eb2 Mon Sep 17 00:00:00 2001 From: CeruleanRed Date: Wed, 5 Jun 2024 11:00:18 +0200 Subject: [PATCH] fix: clear playlist if clear flag is set - Specifically continue to play the playlist at the insertion index - Remove what seems to be a left over commented out section --- jellyfin_kodi/objects/actions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jellyfin_kodi/objects/actions.py b/jellyfin_kodi/objects/actions.py index 34760167..dbac009e 100644 --- a/jellyfin_kodi/objects/actions.py +++ b/jellyfin_kodi/objects/actions.py @@ -166,13 +166,12 @@ class Actions(object): playlist = self.get_playlist(item) player = xbmc.Player() - # xbmc.executebuiltin("Playlist.Clear") # Clear playlist to remove the previous item from playlist position no.2 - if clear: if player.isPlaying(): player.stop() xbmc.executebuiltin('ActivateWindow(busydialognocancel)') + playlist.clear() index = 0 else: index = max(playlist.getposition(), 0) + 1 # Can return -1 @@ -196,11 +195,12 @@ class Actions(object): playutils.set_properties(item, item['PlaybackInfo']['Method'], self.server_id) playlist.add(item['PlaybackInfo']['Path'], listitem, index) - index += 1 if clear: xbmc.executebuiltin('Dialog.Close(busydialognocancel)') - player.play(playlist) + player.play(playlist, startpos=index) + + index += 1 server_address = item['PlaybackInfo']['ServerAddress'] token = item['PlaybackInfo']['Token']