Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="https://developer.spotify.com/documentation/web-api/reference/get-an-artists-albums">Spotify Web API References / Get Artist's Albums</a>
*/
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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class GetArtistsAlbumsRequestTest extends AbstractDataTest<Paging<AlbumSi
.setHttpManager(
TestUtil.MockedHttpManager.returningJson(
"requests/data/artists/GetArtistsAlbumsRequest.json"))
.album_type(ITest.ALBUM_TYPE)
.include_groups(ITest.ALBUM_TYPE)
.limit(ITest.LIMIT)
.market(ITest.MARKET)
.offset(ITest.OFFSET)
Expand All @@ -35,7 +35,7 @@ public GetArtistsAlbumsRequestTest() throws Exception {
public void shouldComplyWithReference() {
assertHasAuthorizationHeader(defaultRequest);
assertEquals(
"https://api.spotify.com:443/v1/artists/0LcJLqbBmaGUft1e9Mm8HV/albums?album_type=album&limit=10&market=SE&offset=0",
"https://api.spotify.com:443/v1/artists/0LcJLqbBmaGUft1e9Mm8HV/albums?include_groups=album&limit=10&market=SE&offset=0",
defaultRequest.getUri().toString());
}

Expand Down