From b6118c999be9217aabe2537e42431d9b6bc79fcb Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Mon, 23 Dec 2024 19:53:20 +0100 Subject: [PATCH] Fix subsonic upload_playlist not properly removing existing entries --- troi/content_resolver/subsonic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/troi/content_resolver/subsonic.py b/troi/content_resolver/subsonic.py index 1d953ba..83a8c36 100755 --- a/troi/content_resolver/subsonic.py +++ b/troi/content_resolver/subsonic.py @@ -255,11 +255,12 @@ def upload_playlist(self, playlist, playlist_id=None): if playlist_id: try: remote_playlist = conn.getPlaylist(pid=playlist_id) + removed_song_idx = list(range(0, remote_playlist["playlist"]["songCount"])) conn.updatePlaylist( lid=playlist_id, name=playlist.playlists[0].name, songIdsToAdd=song_ids, - songIndexesToRemove=list(range(0, len(remote_playlist["playlist"]) - 1)), + songIndexesToRemove=removed_song_idx, ) except DataNotFoundError: conn.createPlaylist(name=playlist.playlists[0].name, songIds=song_ids)