From 1fae780adbbfb0809c79f7147898426849cc7dac Mon Sep 17 00:00:00 2001 From: Nathan Coleman Date: Tue, 31 May 2016 20:02:06 -0400 Subject: [PATCH] Support changing details for a user playlist --- spotipy/client.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spotipy/client.py b/spotipy/client.py index be9162b..685e145 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -378,6 +378,24 @@ class Spotify(object): data = {'name':name, 'public':public } return self._post("users/%s/playlists" % (user,), payload = data) + def user_playlist_change_details( + self, user, playlist_id, name=None, public=None): + ''' Changes a playlist's name and/or public/private state + + Parameters: + - user - the id of the user + - playlist_id - the id of the playlist + - name - optional name of the playlist + - public - optional is the playlist public + ''' + data = {} + if name is not None: + data['name'] = name + if public is not None: + data['public'] = public + return self._put("users/%s/playlists/%s" % (user, playlist_id), + payload=data) + def user_playlist_add_tracks(self, user, playlist_id, tracks, position=None): ''' Adds tracks to a playlist