mirror of
https://github.com/c0de-archive/spotipy.git
synced 2024-11-05 07:27:47 +00:00
Recommendations seeds parameters formatted as a comma seperated list to
comply with Spotify API. Fixes problem of only first seed_artist/track/genre being used to generate recommendations. Mltiple params in the form of "seed_artist=xxxx&seed_artists=yyyy" results in Spotify API ignoring everything but the first parameter.
This commit is contained in:
parent
3f87a8b879
commit
1304ac33c0
@ -676,11 +676,13 @@ class Spotify(object):
|
||||
'''
|
||||
params = dict(limit=limit)
|
||||
if seed_artists:
|
||||
params['seed_artists'] = [self._get_id('artist', a) for a in seed_artists]
|
||||
params['seed_artists'] = ','.join(
|
||||
[self._get_id('artist', a) for a in seed_artists])
|
||||
if seed_genres:
|
||||
params['seed_genres'] = seed_genres
|
||||
params['seed_genres'] = ','.join(seed_genres)
|
||||
if seed_tracks:
|
||||
params['seed_tracks'] = [self._get_id('track', t) for t in seed_tracks]
|
||||
params['seed_tracks'] = ','.join(
|
||||
[self._get_id('track', t) for t in seed_tracks])
|
||||
if country:
|
||||
params['market'] = country
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user