From 2096d32a4e735123bcb5183d18cf92324fe733e0 Mon Sep 17 00:00:00 2001 From: Christopher Li Date: Sun, 22 May 2016 18:57:16 -0400 Subject: [PATCH 1/2] Added user_playlist_unfollow() method --- spotipy/client.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spotipy/client.py b/spotipy/client.py index be9162b..6bcc65c 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -157,7 +157,6 @@ class Spotify(object): else: raise - def _post(self, url, args=None, payload=None, **kwargs): if args: kwargs.update(args) @@ -378,6 +377,16 @@ class Spotify(object): data = {'name':name, 'public':public } return self._post("users/%s/playlists" % (user,), payload = data) + def user_playlist_unfollow(self, user, playlist_id): + ''' Unfollows (deletes) a playlist for a user + + Parameters: + - user - the id of the user + - name - the name of the playlist + - public - is the created playlist public + ''' + return self._delete("users/%s/playlists/%s/followers" % (user, playlist_id)) + def user_playlist_add_tracks(self, user, playlist_id, tracks, position=None): ''' Adds tracks to a playlist From 70701d83872c6d190ca5ba086999693ff5589905 Mon Sep 17 00:00:00 2001 From: Christopher Li Date: Sun, 22 May 2016 19:05:22 -0400 Subject: [PATCH 2/2] Adjusted docstring for user_playlist_unfollow method --- spotipy/client.py | 1 - 1 file changed, 1 deletion(-) diff --git a/spotipy/client.py b/spotipy/client.py index 6bcc65c..a773526 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -383,7 +383,6 @@ class Spotify(object): Parameters: - user - the id of the user - name - the name of the playlist - - public - is the created playlist public ''' return self._delete("users/%s/playlists/%s/followers" % (user, playlist_id))