Add library album management functions

This commit is contained in:
Brecht Yperman 2019-02-19 00:47:07 +01:00 committed by Stephane Bruckert
parent 909fa14977
commit e44bd7a936

View File

@ -708,6 +708,28 @@ class Spotify(object):
''' '''
return self._get('me/player/recently-played', limit=limit) return self._get('me/player/recently-played', limit=limit)
def current_user_saved_albums_delete(self, albums=[]):
""" Remove one or more albums from the current user's
"Your Music" library.
Parameters:
- albums - a list of album URIs, URLs or IDs
"""
alist = [self._get_id('album', a) for a in albums]
r = self._delete('me/albums/?ids=' + ','.join(alist))
return r
def current_user_saved_albums_contains(self, albums=[]):
""" Check if one or more albums is already saved in
the current Spotify users Your Music library.
Parameters:
- albums - a list of album URIs, URLs or IDs
"""
alist = [self._get_id('album', a) for a in albums]
r = self._get('me/albums/contains?ids=' + ','.join(alist))
return r
def current_user_saved_albums_add(self, albums=[]): def current_user_saved_albums_add(self, albums=[]):
""" Add one or more albums to the current user's """ Add one or more albums to the current user's
"Your Music" library. "Your Music" library.