Enable market parameter for album_tracks (#516)

* enable market parameter for album_tracks

* update album_tracks docstring, add CHANGELOG entry
This commit is contained in:
kenmacf 2020-06-19 17:30:54 -04:00 committed by GitHub
parent ccc73b9d22
commit d7ebc611b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added two new attributes: error and error_description to `SpotifyOauthError` exception class to show
authorization/authentication web api errors details.
- Allow extending `SpotifyClientCredentials` and `SpotifyOAuth`
- Added the market paramter to `album_tracks`
### Deprecated

View File

@ -339,18 +339,20 @@ class Spotify(object):
trid = self._get_id("album", album_id)
return self._get("albums/" + trid)
def album_tracks(self, album_id, limit=50, offset=0):
def album_tracks(self, album_id, limit=50, offset=0, market=None):
""" Get Spotify catalog information about an album's tracks
Parameters:
- album_id - the album ID, URI or URL
- limit - the number of items to return
- offset - the index of the first item to return
- market - an ISO 3166-1 alpha-2 country code.
"""
trid = self._get_id("album", album_id)
return self._get(
"albums/" + trid + "/tracks/", limit=limit, offset=offset
"albums/" + trid + "/tracks/", limit=limit, offset=offset, market=market
)
def albums(self, albums):