Merge pull request #122 from jotsif/market_for_tracks_call

Add market parameter to tracks() call
This commit is contained in:
Paul Lamere 2016-12-31 09:54:12 -05:00 committed by GitHub
commit 4966799c55

View File

@ -211,15 +211,16 @@ class Spotify(object):
trid = self._get_id('track', track_id) trid = self._get_id('track', track_id)
return self._get('tracks/' + trid) return self._get('tracks/' + trid)
def tracks(self, tracks): def tracks(self, tracks, market = None):
''' returns a list of tracks given a list of track IDs, URIs, or URLs ''' returns a list of tracks given a list of track IDs, URIs, or URLs
Parameters: Parameters:
- tracks - a list of spotify URIs, URLs or IDs - tracks - a list of spotify URIs, URLs or IDs
- market - an ISO 3166-1 alpha-2 country code.
''' '''
tlist = [self._get_id('track', t) for t in tracks] tlist = [self._get_id('track', t) for t in tracks]
return self._get('tracks/?ids=' + ','.join(tlist)) return self._get('tracks/?ids=' + ','.join(tlist), market = market)
def artist(self, artist_id): def artist(self, artist_id):
''' returns a single artist given the artist's ID, URI or URL ''' returns a single artist given the artist's ID, URI or URL