From 2aa67580a1ae0630618d9f374f258fe8f6a46bc3 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Mon, 12 Aug 2019 16:03:29 -0700 Subject: [PATCH] Add current_user_saved_albums_delete method --- spotipy/client.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/spotipy/client.py b/spotipy/client.py index 3f57251..3c556d3 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -608,7 +608,7 @@ class Spotify(object): ''' return self._get('me/player/currently-playing') - def current_user_saved_albums(self, limit=600, offset=0): + def current_user_saved_albums(self, limit=20, offset=0): """ Gets a list of the albums saved in the current authorized user's "Your Music" library @@ -619,6 +619,18 @@ class Spotify(object): """ return self._get('me/albums', limit=limit, offset=offset) + def current_user_saved_albums_delete(self, albums=None): + """ Remove one or more albums from the current user's + "Your Music" library. + + Parameters: + - albums - a list of album URIs, URLs or IDs + """ + alist = [] + if albums is not None: + alist = [self._get_id('album', a) for a in albums] + return self._delete('me/albums/?ids=' + ','.join(alist)) + def current_user_saved_tracks(self, limit=20, offset=0): """ Gets a list of the tracks saved in the current authorized user's "Your Music" library