Added the parameter collaborative to user_playlist_create and "collaborative" key into data (#546)

This commit is contained in:
BozeBro 2020-07-27 00:49:30 -05:00 committed by GitHub
parent f136442c2d
commit d1c16daa97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -743,16 +743,22 @@ class Spotify(object):
"users/%s/playlists" % user, limit=limit, offset=offset
)
def user_playlist_create(self, user, name, public=True, description=""):
def user_playlist_create(self, user, name, public=True, collaborative=False, description=""):
""" Creates a playlist for a user
Parameters:
- user - the id of the user
- name - the name of the playlist
- public - is the created playlist public
- collaborative - is the created playlist collaborative
- description - the description of the playlist
"""
data = {"name": name, "public": public, "description": description}
data = {
"name": name,
"public": public,
"collaborative": collaborative,
"description": description
}
return self._post("users/%s/playlists" % (user,), payload=data)