Skip to content

Commit

Permalink
Fix playlist index for removals
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Oct 23, 2024
1 parent 90e382a commit cc6d02d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion music_assistant/server/providers/builtin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ async def remove_playlist_tracks(
playlist_items = await self._read_playlist_file_items(prov_playlist_id)
# remove items by index
for i in sorted(positions_to_remove, reverse=True):
del playlist_items[i]
del playlist_items[i - 1]
# store playlist file
await self._write_playlist_file_items(prov_playlist_id, playlist_items)
# mark last_updated on playlist object
Expand Down
2 changes: 1 addition & 1 deletion music_assistant/server/providers/deezer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ async def remove_playlist_tracks(
) -> None:
"""Remove track(s) from playlist."""
playlist_track_ids = []
for track in await self.get_playlist_tracks(prov_playlist_id, 0, 10000):
for track in await self.get_playlist_tracks(prov_playlist_id, 0):
if track.position in positions_to_remove:
playlist_track_ids.append(int(track.item_id))
if len(playlist_track_ids) == len(positions_to_remove):
Expand Down

0 comments on commit cc6d02d

Please sign in to comment.