From da1e009dfa723e0019a4c0338b910420ea05fd70 Mon Sep 17 00:00:00 2001 From: Faruk Sahin Date: Tue, 20 May 2014 14:54:58 +0200 Subject: [PATCH] Add country parameter to artist_albums If country parameter is passed to artist_albums call, only the albums available in the provided country will be returned --- spotipy/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spotipy/__init__.py b/spotipy/__init__.py index 0efdb5e..c0dfd61 100644 --- a/spotipy/__init__.py +++ b/spotipy/__init__.py @@ -124,12 +124,12 @@ class Spotify(object): tlist = [self._get_id('artist', a) for a in artists] return self.get('artists/?ids=' + ','.join(tlist)) - def artist_albums(self, artist_id, album_type=None, limit=20, offset=0): + def artist_albums(self, artist_id, album_type=None, country=None, limit=20, offset=0): ''' Get Spotify catalog information about an artist’s albums ''' trid = self._get_id('artist', artist_id) - return self.get('artists/' + trid + '/albums', album_type=album_type, limit=limit, offset=offset) + return self.get('artists/' + trid + '/albums', album_type=album_type, country=country, limit=limit, offset=offset) def artist_top_tracks(self, artist_id, country='US'): ''' Get Spotify catalog information about an artist’s top 10 tracks by country.