From 51158fe94db96be16d9947046ce3f424200d3bc5 Mon Sep 17 00:00:00 2001
From: Julius <30121440+julius-d@users.noreply.github.com>
Date: Sat, 14 Jun 2025 15:31:54 +0200
Subject: [PATCH 1/2] feat: add include_groups filter to
GetArtistsAlbumsRequest and deprecate album_type
The `album_type` param has no effect and also
the documentation (https://developer.spotify.com/documentation/web-api/reference/get-an-artists-albums)
only mentions `include_groups`
---
.../data/artists/GetArtistsAlbumsRequest.java | 17 +++++++++++++++++
.../artists/GetArtistsAlbumsRequestTest.java | 4 ++--
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/main/java/se/michaelthelin/spotify/requests/data/artists/GetArtistsAlbumsRequest.java b/src/main/java/se/michaelthelin/spotify/requests/data/artists/GetArtistsAlbumsRequest.java
index cc011b535..42c12dd91 100644
--- a/src/main/java/se/michaelthelin/spotify/requests/data/artists/GetArtistsAlbumsRequest.java
+++ b/src/main/java/se/michaelthelin/spotify/requests/data/artists/GetArtistsAlbumsRequest.java
@@ -75,13 +75,30 @@ public Builder id(final String id) {
* supplied, all album types will be returned. Valid values are: {@code album}, {@code single},
* {@code appears_on} and {@code compilation}.
* @return A {@link GetArtistsAlbumsRequest.Builder}.
+ * @deprecated Use {@link #include_groups(String)} instead.
*/
+ @Deprecated
public Builder album_type(final String album_type) {
assert (album_type != null);
assert (album_type.matches("((^|,)(single|album|appears_on|compilation))+$"));
return setQueryParameter("album_type", album_type);
}
+ /**
+ * The include groups filter setter.
+ *
+ * @param include_groups Optional. A comma-separated list of keywords that will be used to filter the response. If not
+ * supplied, all album types will be returned. Valid values are: {@code album}, {@code single},
+ * {@code appears_on} and {@code compilation}.
+ * @return A {@link GetArtistsAlbumsRequest.Builder}.
+ * @see Spotify Web API References / Get Artist's Albums
+ */
+ public Builder include_groups(final String include_groups) {
+ assert (include_groups != null);
+ assert (include_groups.matches("((^|,)(single|album|appears_on|compilation))+$"));
+ return setQueryParameter("include_groups", include_groups);
+ }
+
/**
* The market filter setter.
*
diff --git a/src/test/java/se/michaelthelin/spotify/requests/data/artists/GetArtistsAlbumsRequestTest.java b/src/test/java/se/michaelthelin/spotify/requests/data/artists/GetArtistsAlbumsRequestTest.java
index c6554a68a..c1bd4fde5 100644
--- a/src/test/java/se/michaelthelin/spotify/requests/data/artists/GetArtistsAlbumsRequestTest.java
+++ b/src/test/java/se/michaelthelin/spotify/requests/data/artists/GetArtistsAlbumsRequestTest.java
@@ -22,7 +22,7 @@ public class GetArtistsAlbumsRequestTest extends AbstractDataTest
Date: Wed, 23 Jul 2025 08:59:46 +0200
Subject: [PATCH 2/2] ci: trigger