From 98ebb6a163b0d5c84f470e3a8b4fa98415274bfa Mon Sep 17 00:00:00 2001 From: Matthew Duck Date: Mon, 1 Dec 2014 23:21:05 +0000 Subject: [PATCH] Fix remove_specific_occurrences function user_playlist_remove_specific_occurrences_of_tracks is expecting a different tracklist object to the one that is documented, causing a "'dict' object has no attribute 'split'" error. Update it to expect the correct format. --- spotipy/client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spotipy/client.py b/spotipy/client.py index 99476e6..c3df941 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -374,7 +374,12 @@ class Spotify(object): ''' plid = self._get_id('playlist', playlist_id) - ftracks = [ self._get_uri('track', tid) for tid in tracks] + ftracks = [] + for tr in tracks: + ftracks.append({ + "uri": self._get_uri("track", tr["uri"]), + "positions": tr["positions"], + }) payload = { "tracks": ftracks } return self._delete("users/%s/playlists/%s/tracks" % (user, plid), payload = payload)