[GH-ISSUE #286] Remove one occurrence of track from playlist #159

Closed
opened 2026-02-27 23:21:08 +03:00 by kerem · 1 comment
Owner

Originally created by @stavlocker on GitHub (May 9, 2018).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/286

Hello.
I'm currently making a script to remove duplicates and I'm trying to figure out a way to remove just one occurrence of a track from a playlist.
Currently there are only user_playlist_remove_all_occurrences_of_tracks to remove all occurrences of a track, or user_playlist_remove_specific_occurrences_of_tracks which requires a specific position to be delivered as well.

Is there a way to remove just one occurrence of a track from a playlist without having to loop through the list, finding a track that's the same as the one I'm looking for, grab it's position and use the specific occurrences method?

Originally created by @stavlocker on GitHub (May 9, 2018). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/286 Hello. I'm currently making a script to remove duplicates and I'm trying to figure out a way to remove just one occurrence of a track from a playlist. Currently there are only `user_playlist_remove_all_occurrences_of_tracks` to remove all occurrences of a track, or `user_playlist_remove_specific_occurrences_of_tracks` which requires a specific position to be delivered as well. Is there a way to remove just one occurrence of a track from a playlist without having to loop through the list, finding a track that's the same as the one I'm looking for, grab it's position and use the specific occurrences method?
kerem closed this issue 2026-02-27 23:21:08 +03:00
Author
Owner

@ritiek commented on GitHub (May 17, 2018):

I don't think Remove Tracks from a Playlist has anything that does what you want to do but personally I think it would be a better idea to write a script (loop, find, grab, use specific occurrences method) than providing a new method specifically for what you're trying to do. Just my opinion though.

<!-- gh-comment-id:389812471 --> @ritiek commented on GitHub (May 17, 2018): I don't think [Remove Tracks from a Playlist ](https://beta.developer.spotify.com/documentation/web-api/reference/playlists/remove-tracks-playlist/) has anything that does what you want to do but personally I think it would be a better idea to write a script (loop, find, grab, use specific occurrences method) than providing a new method specifically for what you're trying to do. Just my opinion though.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#159
No description provided.