mirror of
https://github.com/c0de-archive/spotipy.git
synced 2024-11-05 07:27:47 +00:00
Support optional collaborative kwarg
This commit is contained in:
parent
7c5bfbdf86
commit
5ecfad1d3a
@ -383,7 +383,8 @@ class Spotify(object):
|
||||
return self._post("users/%s/playlists" % (user,), payload=data)
|
||||
|
||||
def user_playlist_change_details(
|
||||
self, user, playlist_id, name=None, public=None):
|
||||
self, user, playlist_id, name=None, public=None,
|
||||
collaborative=None):
|
||||
''' Changes a playlist's name and/or public/private state
|
||||
|
||||
Parameters:
|
||||
@ -391,12 +392,15 @@ class Spotify(object):
|
||||
- playlist_id - the id of the playlist
|
||||
- name - optional name of the playlist
|
||||
- public - optional is the playlist public
|
||||
- collaborative - optional is the playlist collaborative
|
||||
'''
|
||||
data = {}
|
||||
if name is not None:
|
||||
data['name'] = name
|
||||
if public is not None:
|
||||
if isinstance(public, bool):
|
||||
data['public'] = public
|
||||
if isinstance(collaborative, bool):
|
||||
data['collaborative'] = collaborative
|
||||
return self._put("users/%s/playlists/%s" % (user, playlist_id),
|
||||
payload=data)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user