Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spotify web api is ignoring the position param in delete /playlists/{playlist_id}/tracks #1098

Open
lfg6000 opened this issue May 5, 2024 · 4 comments
Labels
api-bug A bug in the Spotify API, not in the library itself

Comments

@lfg6000
Copy link
Contributor

lfg6000 commented May 5, 2024

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

@lfg6000 lfg6000 added the bug label May 5, 2024
@dieser-niko dieser-niko added api-bug A bug in the Spotify API, not in the library itself and removed bug labels May 5, 2024
@dieser-niko
Copy link
Member

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.
#1099 (comment)

@lfg6000
Copy link
Contributor Author

lfg6000 commented May 12, 2024

just tried it. it appears spotify is still ignoring the position param sent by playlist_remove_specific_occurrences_of_items()

@lfg6000
Copy link
Contributor Author

lfg6000 commented 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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-bug A bug in the Spotify API, not in the library itself
Projects
None yet
Development

No branches or pull requests

2 participants