Add current_user_saved_albums_delete method

This commit is contained in:
Ryan Lee 2019-08-12 16:03:29 -07:00 committed by Stephane Bruckert
parent c610090a7c
commit 2aa67580a1

View File

@ -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