From 730cfa5578d92f8b0ee587719e14cbdf8c117379 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 30 Oct 2026 15:47:53 +0000 Subject: [PATCH] Send playlist items to remove in the items field Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SLHDn51P7snTSyxtuDToEb --- src/spotifyaio/spotify.py | 2 +- tests/test_spotify.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spotifyaio/spotify.py b/src/spotifyaio/spotify.py index de317283..b7d8ef87 100644 --- a/src/spotifyaio/spotify.py +++ b/src/spotifyaio/spotify.py @@ -545,7 +545,7 @@ async def remove_playlist_items( msg = "Maximum of 100 tracks can be removed at once" raise ValueError(msg) identifier = get_identifier(playlist_id) - data: dict[str, Any] = {"tracks": [{"uri": uri} for uri in uris]} + data: dict[str, Any] = {"items": [{"uri": uri} for uri in uris]} if snapshot_id: data["snapshot_id"] = snapshot_id response = await self._delete(f"v1/playlists/{identifier}/items", data=data) diff --git a/tests/test_spotify.py b/tests/test_spotify.py index e366333b..ffe46396 100644 --- a/tests/test_spotify.py +++ b/tests/test_spotify.py @@ -1418,7 +1418,7 @@ async def test_add_too_many_playlist_items( [ ( {"uris": ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh"]}, - {"tracks": [{"uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh"}]}, + {"items": [{"uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh"}]}, ), ( { @@ -1429,7 +1429,7 @@ async def test_add_too_many_playlist_items( "snapshot_id": "AAAACG9jmE4O/USJ4XSA7mfhfXkaxawY", }, { - "tracks": [ + "items": [ {"uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh"}, {"uri": "spotify:track:1301WleyT98MSxVHPZCA6M"}, ],