Repository navigation
Conversation
Take a playlist out of the user's library by removing its entry from the rootlist, which is how Spotify deletes a playlist the user owns and unfollows one of someone else's. Like removing a track, the entry is removed by index range in a change based on the rootlist's revision, and read again and retried once if the rootlist moved on in between. A playlist that is not in the library answers 404. The rootlist is read and changed through the same code as a playlist: listContents and listChange now take the list's path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Create an empty playlist owned by the user and add it to the top of the user's library, where Spotify shows a new playlist. Creating is sent once, as a resent request could create a second playlist; adding to the rootlist is based on its current revision and retried once if it moved on in between. The response carries the new playlist's uri. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the two endpoints a client needs to manage the playlists themselves, after #403 and #411 made it possible to edit their contents.
POST /library/playlists/create{"name"}creates an empty playlist owned by the user and answers{"uri"}.POST /playlist/v2/playlist, whose body is anOpListwhoseUPDATE_LIST_ATTRIBUTESop sets the name, as Spotify's web player sends it. I first sent aListUpdateRequestwith the name in its attributes: Spotify created the playlist but ignored the name.RequestOnce): if a resent request reached the server after the first one already had, it would create a second playlist.ADDat index 0), where Spotify shows a new playlist. This change is based on the rootlist's current revision and is retried once if the rootlist changed in between. If adding fails, the error names the playlist that was created.POST /library/playlists/remove{"playlist_uri"}takes a playlist out of the user's library by removing its entry from the rootlist. That is how Spotify deletes a playlist the user owns and unfollows one of someone else's. Like for a deleted playlist in Spotify, its followers keep it and it can be restored.remove_track, the entry is removed by index range in a change based on the rootlist's revision. The rootlist is read again and the removal retried once if it changed meanwhile.listContentsandlistChangenow take the list's path.Testing
OpListthe create request sends and the uri read from its replygo mod tidy,go generate ./...,gofmt, build andgo test -race -tags "test_unit test_integration" ./...are clean.🤖 Generated with Claude Code