Update __init__.py

user_playlist doesn't work with starred playlists, which pass an ID of None.

This will allow the user to pull data for starred playlists, which use the URI users/%s/starrred
This commit is contained in:
corycorycory 2014-06-21 10:45:23 -05:00
parent ceaa030468
commit f4e11ed170
1 changed files with 2 additions and 0 deletions

View File

@ -206,6 +206,8 @@ class Spotify(object):
def user_playlist(self, user, playlist_id, fields=None):
''' Gets playlist of a user
'''
if playlist_id == None:
return self.get("users/%s/starred" % (user), fields=fields)
return self.get("users/%s/playlists/%s" % (user, playlist_id), fields=fields)
def user_playlist_create(self, user, name, public=True):