Add current_user_saved_albums_delete method

This commit is contained in:
Ryan Lee authored and Stephane Bruckert committed 2020-01-11 19:56:32 +00:00
1 parent c610090a7c
commit 2aa67580a1
1 file changed
+13 -1
+13 -1
View File
@@ -608,7 +608,7 @@ class Spotify(object):
''' '''
return self._get('me/player/currently-playing') 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 """ Gets a list of the albums saved in the current authorized user's
"Your Music" library "Your Music" library
@@ -619,6 +619,18 @@ class Spotify(object):
""" """
return self._get('me/albums', limit=limit, offset=offset) 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): def current_user_saved_tracks(self, limit=20, offset=0):
""" Gets a list of the tracks saved in the current authorized user's """ Gets a list of the tracks saved in the current authorized user's
"Your Music" library "Your Music" library