mirror of
https://github.com/c0de-archive/spotipy.git
synced 2025-01-08 15:42:48 +00:00
Support changing details for a user playlist
This commit is contained in:
parent
1e8188206a
commit
1fae780adb
@ -378,6 +378,24 @@ class Spotify(object):
|
|||||||
data = {'name':name, 'public':public }
|
data = {'name':name, 'public':public }
|
||||||
return self._post("users/%s/playlists" % (user,), payload = data)
|
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,
|
def user_playlist_add_tracks(self, user, playlist_id, tracks,
|
||||||
position=None):
|
position=None):
|
||||||
''' Adds tracks to a playlist
|
''' Adds tracks to a playlist
|
||||||
|
Loading…
Reference in New Issue
Block a user