Skip to content

Commit d6b0ef9

Browse files
committed
Merge branch 'mattiamaestrini-get_artist_top_track'
2 parents 9cc1425 + 1a0db60 commit d6b0ef9

File tree

2 files changed

+5
-31
lines changed

2 files changed

+5
-31
lines changed

spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyService.java

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -739,45 +739,23 @@ public interface SpotifyService {
739739
* Get Spotify catalog information about an artist’s top tracks by country.
740740
*
741741
* @param artistId The Spotify ID for the artist.
742-
* @param options Optional parameters. For list of supported parameters see
743-
* <a href="https://developer.spotify.com/web-api/get-artists-top-tracks/">endpoint documentation</a>
744-
* @param callback Callback method
745-
* @see <a href="https://developer.spotify.com/web-api/get-artists-top-tracks/">Get an Artist’s Top Tracks</a>
746-
*/
747-
@GET("/artists/{id}/top-tracks")
748-
public void getArtistTopTrack(@Path("id") String artistId, @QueryMap Map<String, Object> options, Callback<Tracks> callback);
749-
750-
/**
751-
* Get Spotify catalog information about an artist’s top tracks by country.
752-
*
753-
* @param artistId The Spotify ID for the artist.
754-
* @param options Optional parameters. For list of supported parameters see
755-
* <a href="https://developer.spotify.com/web-api/get-artists-top-tracks/">endpoint documentation</a>
756-
* @return An object whose key is "tracks" and whose value is an array of track objects.
757-
* @see <a href="https://developer.spotify.com/web-api/get-artists-top-tracks/">Get an Artist’s Top Tracks</a>
758-
*/
759-
@GET("/artists/{id}/top-tracks")
760-
public Tracks getArtistTopTrack(@Path("id") String artistId, @QueryMap Map<String, Object> options);
761-
762-
/**
763-
* Get Spotify catalog information about an artist’s top tracks by country.
764-
*
765-
* @param artistId The Spotify ID for the artist.
742+
* @param country The country: an ISO 3166-1 alpha-2 country code.
766743
* @param callback Callback method
767744
* @see <a href="https://developer.spotify.com/web-api/get-artists-top-tracks/">Get an Artist’s Top Tracks</a>
768745
*/
769746
@GET("/artists/{id}/top-tracks")
770-
public void getArtistTopTrack(@Path("id") String artistId, Callback<Tracks> callback);
747+
public void getArtistTopTrack(@Path("id") String artistId, @Query("country") String country, Callback<Tracks> callback);
771748

772749
/**
773750
* Get Spotify catalog information about an artist’s top tracks by country.
774751
*
775752
* @param artistId The Spotify ID for the artist.
753+
* @param country The country: an ISO 3166-1 alpha-2 country code.
776754
* @return An object whose key is "tracks" and whose value is an array of track objects.
777755
* @see <a href="https://developer.spotify.com/web-api/get-artists-top-tracks/">Get an Artist’s Top Tracks</a>
778756
*/
779757
@GET("/artists/{id}/top-tracks")
780-
public Tracks getArtistTopTrack(@Path("id") String artistId);
758+
public Tracks getArtistTopTrack(@Path("id") String artistId, @Query("country") String country);
781759

782760
/**
783761
* Get Spotify catalog information about artists similar to a given artist.

spotify-api/src/test/java/kaaes/spotify/webapi/android/SpotifyServiceTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -956,11 +956,7 @@ public void shouldGetArtistTopTracksTracks() throws Exception {
956956
Response response = TestUtils.getResponseFromModel(fixture, Tracks.class);
957957
when(mMockClient.execute(isA(Request.class))).thenReturn(response);
958958

959-
final Map<String, Object> options = new HashMap<String, Object>();
960-
options.put(SpotifyService.OFFSET, 0);
961-
options.put(SpotifyService.LIMIT, 10);
962-
options.put(SpotifyService.COUNTRY, "SE");
963-
Tracks tracks = mSpotifyService.getArtistTopTrack("test", options);
959+
Tracks tracks = mSpotifyService.getArtistTopTrack("test", "SE");
964960
compareJSONWithoutNulls(body, tracks);
965961
}
966962

0 commit comments

Comments
 (0)