Skip to content

Commit

Permalink
Merge pull request #158 from phw/fix_subsonic_update_playlist
Browse files Browse the repository at this point in the history
Fix subsonic upload_playlist not properly removing existing entries
  • Loading branch information
mayhem authored Jan 6, 2025
2 parents b3b31ca + b6118c9 commit a0aac57
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 a0aac57

Please sign in to comment.