Skip to content

Commit

Permalink
Merge pull request #871 from CeruleanRed/fix/fix-up-next-compatability
Browse files Browse the repository at this point in the history
Clear playlist if clear flag is set (UpNext)
  • Loading branch information
oddstr13 authored Jun 8, 2024
2 parents 580384d + 91b35cb commit f209f9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jellyfin_kodi/objects/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,12 @@ def play_playlist(self, items, clear=True, seektime=None, audio=None, subtitle=N
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
Expand All @@ -196,11 +195,12 @@ def play_playlist(self, items, clear=True, seektime=None, audio=None, subtitle=N
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']
Expand Down

0 comments on commit f209f9e

Please sign in to comment.