Replaced argument "album_type" with "include_groups" in "Spotify.artist_albums"

This commit is contained in:
Niko authored and GitHub committed 2024-05-17 12:35:23 +02:00
1 parent 028539e08a
commit 2e54f2c138
2 files changed
+14 -3

No files matched your search

+13 -3
View File
@@ -405,22 +405,32 @@ class Spotify(object):
return self._get("artists/?ids=" + ",".join(tlist))
def artist_albums(
self, artist_id, album_type=None, country=None, limit=20, offset=0
self, artist_id, album_type=None, include_groups=None country=None, limit=20, offset=0
):
""" Get Spotify catalog information about an artist's albums
Parameters:
- artist_id - the artist ID, URI or URL
- album_type - 'album', 'single', 'appears_on', 'compilation'
- include_groups - the types of items to return. One or more of 'album', 'single',
'appears_on', 'compilation'. If multiple types are desired,
pass in a comma separated string; e.g., 'album,single'.
- country - limit the response to one particular country.
- limit - the number of albums to return
- offset - the index of the first album to return
"""
if album_type:
warnings.warn(
"You're using `artist_albums(..., album_type='...')` which will be removed in future versions. "
"Please adjust your code accordingly by using `artist_albums(..., include_groups='...')` instead.",
DeprecationWarning,
)
include_groups = album_type if include_groups is None else include_groups
trid = self._get_id("artist", artist_id)
return self._get(
"artists/" + trid + "/albums",
album_type=album_type,
include_groups=include_groups,
country=country,
limit=limit,
offset=offset,