Skip to content

Add single item helpers to save and remove library items - #865

Merged
joostlek merged 1 commit into
mainfrom
ccr-af58c15a-nqvsya-single-library-helpers
Oct 30, 2026
Merged

joostlek merged 1 commit into
mainfrom
ccr-af58c15a-nqvsya-single-library-helpers

Conversation

@joostlek

Copy link
Copy Markdown
Owner

Proposed Changes

The library API already has a single-item check, is_added_to_library(uri), next to the batch are_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 to save_to_library([uri])
  • remove_item_from_library(uri) delegates to remove_from_library([uri])

They delegate to the batch methods, so the request handling stays in one place. Since /me/library also 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

@joostlek joostlek added the new-feature New features or options. label Oct 30, 2026 — with Claude
@sonarqubecloud

Copy link
Copy Markdown

@joostlek
joostlek merged commit 0c693d3 into main Oct 30, 2026
14 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

new-feature New features or options.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants