Skip to content

Commit

Permalink
Fix subsonic upload_playlist not properly removing existing entries
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Dec 23, 2024
1 parent 0b9b60c commit b6118c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion troi/content_resolver/subsonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b6118c9

Please sign in to comment.