Repository navigation
Add single item helpers to save and remove library items - #865
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SLHDn51P7snTSyxtuDToEb
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Proposed Changes
The library API already has a single-item check,
is_added_to_library(uri), next to the batchare_in_library(uris). Saving or removing one item still meant wrapping it in a list. This adds the matching helpers:save_item_to_library(uri)delegates tosave_to_library([uri])remove_item_from_library(uri)delegates toremove_from_library([uri])They delegate to the batch methods, so the request handling stays in one place. Since
/me/libraryalso replaced the follow endpoints, these cover following and unfollowing artists, users and playlists too, e.g.save_item_to_library("spotify:artist:…").Tests use artist and playlist URIs to cover that.
Related Issues
Generated by Claude Code