Skip to content

Commit 06c6b57

Browse files
committed
Update to spotify-web-api-core 2021.7.20
1 parent 6089b94 commit 06c6b57

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8-
- Update to spotify-web-api-core `2021.6.30`
9-
- Fix tracks property in `Recommendations`
8+
- Update to spotify-web-api-core `2021.7.20`
9+
- Fix `tracks` property in `Recommendations`
10+
- Mark `market` parameter in "Get Playlist's Items" endpoint as optional
1011

1112
## [2.2.0]
1213
- Update to spotify-web-api-core `2021.6.18`

spotify-web-api-java-generator/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<url>https://github.com/sonallux/spotify-web-api-java</url>
2121

2222
<properties>
23-
<spotify-web-api-core.version>2021.6.30</spotify-web-api-core.version>
23+
<spotify-web-api-core.version>2021.7.20</spotify-web-api-core.version>
2424
<guava.version>30.1.1-jre</guava.version>
2525
<picocli.version>4.6.1</picocli.version>
2626
<flexmark.version>0.62.2</flexmark.version>

spotify-web-api-java/src/main/generated/de/sonallux/spotify/api/apis/PlaylistsApi.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,10 @@ public GetPlaylistCoverRequest getPlaylistCover(String playlistId) {
8686
* <h3>Get a Playlist's Items</h3>
8787
* <p>Get full details of the items of a playlist owned by a Spotify user.</p>
8888
* @param playlistId <p>The <a href="https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids">Spotify ID</a> for the playlist.</p>
89-
* @param market <p>An <a href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2 country code</a> or the string <code>from_token</code>. Provide this parameter if you want to apply <a href="https://developer.spotify.com/documentation/general/guides/track-relinking-guide/">Track Relinking</a>. For episodes, if a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.<br><em>Note: If neither market or user country are provided, the episode is considered unavailable for the client.</em></p>
9089
* @return a {@link GetPlaylistsTracksRequest} object to build and execute the request
9190
*/
92-
public GetPlaylistsTracksRequest getPlaylistsTracks(String playlistId, String market) {
93-
return new GetPlaylistsTracksRequest(apiClient, playlistId, market);
91+
public GetPlaylistsTracksRequest getPlaylistsTracks(String playlistId) {
92+
return new GetPlaylistsTracksRequest(apiClient, playlistId);
9493
}
9594

9695
/**

spotify-web-api-java/src/main/generated/de/sonallux/spotify/api/apis/playlists/GetPlaylistsTracksRequest.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,23 @@ public class GetPlaylistsTracksRequest {
2121
* <h3>Get a Playlist's Items request</h3>
2222
* @param apiClient <p>The API client</p>
2323
* @param playlistId <p>The <a href="https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids">Spotify ID</a> for the playlist.</p>
24-
* @param market <p>An <a href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2 country code</a> or the string <code>from_token</code>. Provide this parameter if you want to apply <a href="https://developer.spotify.com/documentation/general/guides/track-relinking-guide/">Track Relinking</a>. For episodes, if a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.<br><em>Note: If neither market or user country are provided, the episode is considered unavailable for the client.</em></p>
2524
*/
26-
public GetPlaylistsTracksRequest(ApiClient apiClient, String playlistId, String market) {
25+
public GetPlaylistsTracksRequest(ApiClient apiClient, String playlistId) {
2726
this.apiClient = apiClient;
2827
this.request = new Request("GET", "/playlists/{playlist_id}/tracks")
2928
.addPathParameter("playlist_id", String.valueOf(playlistId))
30-
.addQueryParameter("market", String.valueOf(market))
3129
;
3230
this.additionalTypes("track,episode");
3331
}
3432

33+
/**
34+
* <p>An <a href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2 country code</a> or the string <code>from_token</code>. Provide this parameter if you want to apply <a href="https://developer.spotify.com/documentation/general/guides/track-relinking-guide/">Track Relinking</a>. For episodes, if a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.<br><em>Note: If neither market or user country are provided, the episode is considered unavailable for the client.</em></p>
35+
*/
36+
public GetPlaylistsTracksRequest market(String market) {
37+
this.request.addQueryParameter("market", String.valueOf(market));
38+
return this;
39+
}
40+
3541
/**
3642
* <p>Filters for the query: a comma-separated list of the fields to return. If omitted, all fields are returned. For example, to get just the total number of items and the request limit:<br><code>fields=total,limit</code><br>A dot separator can be used to specify non-reoccurring fields, while parentheses can be used to specify reoccurring fields within objects. For example, to get just the added date and user ID of the adder:<br><code>fields=items(added_at,added_by.id)</code><br>Use multiple parentheses to drill down into nested objects, for example:<br><code>fields=items(track(name,href,album(name,href)))</code><br>Fields can be excluded by prefixing them with an exclamation mark, for example:<br><code>fields=items.track.album(!external_urls,images)</code></p>
3743
*/

spotify-web-api-java/src/test/java/de/sonallux/spotify/api/ConversionTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void testRequestWithSnakeCaseToCamelCase() throws Exception {
9797
void testUnionTypeHandlingWithAdditionalTypesParameter() throws Exception {
9898
webServer.enqueue(loadMockResponse("get-playlists-tracks-union.json"));
9999

100-
var response = api.getPlaylistsApi().getPlaylistsTracks("foo", "DE").build().execute();
100+
var response = api.getPlaylistsApi().getPlaylistsTracks("foo").build().execute();
101101
var track = response.getItems().get(0).getTrack();
102102
assertNotNull(track);
103103
assertEquals("track", track.getType());
@@ -110,14 +110,14 @@ void testUnionTypeHandlingWithAdditionalTypesParameter() throws Exception {
110110
assertNotNull(((Episode) episode).getShow());
111111

112112
var request = webServer.takeRequest();
113-
assertEquals("/playlists/foo/tracks?market=DE&additional_types=track%2Cepisode", request.getPath());
113+
assertEquals("/playlists/foo/tracks?additional_types=track%2Cepisode", request.getPath());
114114
}
115115

116116
@Test
117117
void testUnionTypeHandlingWithoutAdditionalTypesParameter() throws Exception {
118118
webServer.enqueue(loadMockResponse("get-playlists-tracks.json"));
119119

120-
var response = api.getPlaylistsApi().getPlaylistsTracks("foo", "DE")
120+
var response = api.getPlaylistsApi().getPlaylistsTracks("foo")
121121
.additionalTypes("track")
122122
.build().execute();
123123
var track = response.getItems().get(0).getTrack();
@@ -132,7 +132,7 @@ void testUnionTypeHandlingWithoutAdditionalTypesParameter() throws Exception {
132132
assertNull(((Episode) episode).getShow());//show is not set, because episode is returned with track format
133133

134134
var request = webServer.takeRequest();
135-
assertEquals("/playlists/foo/tracks?market=DE&additional_types=track", request.getPath());
135+
assertEquals("/playlists/foo/tracks?additional_types=track", request.getPath());
136136
}
137137

138138
@Test

0 commit comments

Comments
 (0)