mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #1098] spotify web api is ignoring the position param in delete /playlists/{playlist_id}/tracks #653
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#653
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lfg6000 on GitHub (May 5, 2024).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1098
summary
playlist_remove_specific_occurrences_of_items(playlist_id, items, snapshot_id=None) uses delete /playlists/{playlist_id}/tracks web api which is currently ignoring the position param in items[{"uri": xxx, "position": xxx}]
here is a link to the spotify dev forum discussing the issue:
https://community.spotify.com/t5/Spotify-for-Developers/Positions-field-in-JSON-body-is-ignored-when-removing-tracks/td-p/6044424
this is the post i put up on the spotify dev forum
removing the position parameter from the web api delete /playlists/{playlist_id}/tracks is a major issue for www.spotifyfinder.com users want to be able to delete a specific duplicate based on position. now that position is being ignored multiple instances of the same track are being removed. this breaks www.spotifyfinder.com i am really hoping that the position parameter is supported once again.
sometimes
sometimes spotify breaks an api and if you wait a couple of weeks spotify will fix the issue. i am hopeful. if the issue gets fixed i will update this issue
@dieser-niko commented on GitHub (May 12, 2024):
Hi, according to this comment, reordering works again (using the same endpoint), so maybe deleting specific occurrences works too. I'll try that when I get around to it.
https://github.com/spotipy-dev/spotipy/issues/1099#issuecomment-2106251082
@lfg6000 commented on GitHub (May 12, 2024):
just tried it. it appears spotify is still ignoring the position param sent by playlist_remove_specific_occurrences_of_items()
@lfg6000 commented on GitHub (May 13, 2024):
Here is an effort to clearly summarize the impact of this api-bug
Prior to this Spotify Change
If you have Multiple Copies of the Same Track in a playlist and you selected ONE of them to be removed, just the selected track would be removed.
After this Spotify Change
If you have Multiple Copies of the Same Track in a playlist and you selected ONE of them to be removed, now ALL copies of the selected track will be removed from the playlist.
Example
If you have two copies of the same track in a playlist you can no longer remove just one of them, both copies of the track will be removed. It is no longer possible to remove duplicates from a playlist using the web api. All you can do is remove all copies of a track from a playlist.
Spotify Web API Documentation
I sure hope the Spotify Remove Playlist Items doc page gets updated to make this clear.
Spotipy Code and Documentation
Once it becomes clear spotify is not going to fix this issue, it seems like the spotipy playlist_remove_specific_occurrences_of_items() api docs and code will need to be updated so that the items param to longer requires a position for each track id.
@dieser-niko commented on GitHub (May 17, 2024):
I think they are trying to make sure that the documentation matches the API. They recently removed an argument that isn't in the documentation for quite a while. Maybe it's the same in this case here. #1107
@dieser-niko commented on GitHub (Jun 19, 2024):
One of the comments in your community post seems to mention UIDs that would identify different items in a playlist. Let's hope this is implemented in the API. Would be a good replacement.
I've also contacted Spotify support directly, maybe a moderator will take a look and give us an answer.
@lfg6000 commented on GitHub (Jun 19, 2024):
thanks for contacting the moderator. maybe the moderator will contact a spotify employee....
@mawkler commented on GitHub (Apr 16, 2025):
This issue seems to still not have been fixed. Did the documentation use to mention a
positionparameter? Now the word "position" only appears in thesnapshot_iddescription:@stephanebruckert commented on GitHub (May 22, 2025):
Closing as this is an issue on the Spotify side:
positionssub-field is now ignored,snapshot_idfield, when specified, gives a 502, which would have beem the best solution if your app kept track ofsnapshot_idswhen adding items.Keeping the spotipy code as-is to reflect the API docs.
If removing possible duplicates, please use this method (removing duplicates, adding them back once).