From f1174ee3cbc370fc33a15d3a3cb13d000cc5e37b Mon Sep 17 00:00:00 2001 From: Michael Thelin Date: Fri, 16 May 2014 12:22:53 +0200 Subject: [PATCH 01/10] Update search URLs --- .../java/se/michaelthelin/spotify/Api.java | 1 - .../spotify/methods/AlbumSearchRequest.java | 3 +- .../spotify/methods/ArtistSearchRequest.java | 3 +- .../spotify/methods/TrackSearchRequest.java | 3 +- .../se/michaelthelin/spotify/ApiTest.java | 43 ++++++++++++++++--- 5 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/main/java/se/michaelthelin/spotify/Api.java b/src/main/java/se/michaelthelin/spotify/Api.java index 61088c379..7d096cde8 100644 --- a/src/main/java/se/michaelthelin/spotify/Api.java +++ b/src/main/java/se/michaelthelin/spotify/Api.java @@ -1,6 +1,5 @@ package se.michaelthelin.spotify; -import com.google.protobuf.RepeatedFieldBuilder; import se.michaelthelin.spotify.UtilProtos.Url.Scheme; import se.michaelthelin.spotify.methods.*; diff --git a/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java b/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java index ef4eadd5c..ac61747c8 100644 --- a/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java +++ b/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java @@ -43,8 +43,9 @@ public static final class Builder extends AbstractRequest.Builder { public Builder query(String query) { assert (query != null); - path("/v1/albums/search"); + path("/v1/search"); String massagedQuery = query.replace(" ", "+"); + parameter("type","album"); return parameter("q", massagedQuery); } diff --git a/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java b/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java index 8aaa6dc00..47e788130 100644 --- a/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java +++ b/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java @@ -44,8 +44,9 @@ public static final class Builder extends AbstractRequest.Builder { public Builder query(String query) { assert (query != null); - path("/v1/artists/search"); + path("/v1/search"); String massagedQuery = query.replace(" ", "+"); + parameter("type","artist"); return parameter("q", massagedQuery); } diff --git a/src/main/java/se/michaelthelin/spotify/methods/TrackSearchRequest.java b/src/main/java/se/michaelthelin/spotify/methods/TrackSearchRequest.java index f3734b483..01455c97e 100644 --- a/src/main/java/se/michaelthelin/spotify/methods/TrackSearchRequest.java +++ b/src/main/java/se/michaelthelin/spotify/methods/TrackSearchRequest.java @@ -43,8 +43,9 @@ public static final class Builder extends AbstractRequest.Builder { public Builder query(String query) { assert (query != null); - path("/v1/tracks/search"); + path("/v1/search"); String massagedQuery = query.replace(" ", "+"); + parameter("type","track"); return parameter("q", massagedQuery); } diff --git a/src/test/java/se/michaelthelin/spotify/ApiTest.java b/src/test/java/se/michaelthelin/spotify/ApiTest.java index 666f53462..c19703e88 100644 --- a/src/test/java/se/michaelthelin/spotify/ApiTest.java +++ b/src/test/java/se/michaelthelin/spotify/ApiTest.java @@ -75,13 +75,29 @@ public void shouldCreateAUrlForArtistsAlbum() { } @Test - public void shouldHaveAlbumTypeParametersInArtistsAlbumUrl() { + public void shouldHaveMultipleAlbumTypeParametersInArtistsAlbumUrl() { Api api = Api.DEFAULT_API; Request request = api.getAlbumsForArtist("4AK6F7OLvEQ5QYCBNiQWHq").types(AlbumType.ALBUM, AlbumType.SINGLE).build(); assertEquals("https://api.spotify.com:443/v1/artists/4AK6F7OLvEQ5QYCBNiQWHq/albums", request.toString()); assertHasParameter(request.toUrl(), "album_type", "ALBUM,SINGLE"); } + @Test + public void shouldHaveSingleAlbumTypeParametersInArtistsAlbumUrl() { + Api api = Api.DEFAULT_API; + Request request = api.getAlbumsForArtist("4AK6F7OLvEQ5QYCBNiQWHq").types(AlbumType.SINGLE).build(); + assertEquals("https://api.spotify.com:443/v1/artists/4AK6F7OLvEQ5QYCBNiQWHq/albums", request.toString()); + assertHasParameter(request.toUrl(), "album_type", "SINGLE"); + } + + @Test + public void shouldFailIfAlbumTypeParametersIsInArtistsAlbumUrl() { + Api api = Api.DEFAULT_API; + Request request = api.getAlbumsForArtist("4AK6F7OLvEQ5QYCBNiQWHq").types(AlbumType.SINGLE).build(); + assertEquals("https://api.spotify.com:443/v1/artists/4AK6F7OLvEQ5QYCBNiQWHq/albums", request.toString()); + assertHasParameter(request.toUrl(), "album_type", "SINGLE"); + } + @Test public void shouldHaveLimitParameterInArtistsAlbumUrl() { Api api = Api.DEFAULT_API; @@ -120,42 +136,47 @@ public void shouldCreateAGetArtistsUrl() { public void shouldCreateSearchUrl() { Api api = Api.DEFAULT_API; Request request = api.searchTracks("moulat swalf").build(); - assertEquals("https://api.spotify.com:443/v1/tracks/search", request.toString()); + assertEquals("https://api.spotify.com:443/v1/search", request.toString()); assertHasParameter(request.toUrl(), "q", "moulat+swalf"); + assertHasParameter(request.toUrl(), "type", "track"); } @Test public void shouldCreateSearchUrlForAlbum() { Api api = Api.DEFAULT_API; Request request = api.searchAlbums("meeep").build(); - assertEquals("https://api.spotify.com:443/v1/albums/search", request.toString()); + assertEquals("https://api.spotify.com:443/v1/search", request.toString()); assertHasParameter(request.toUrl(), "q", "meeep"); + assertHasParameter(request.toUrl(), "type", "album"); } @Test public void shouldCreateSearchUrlForArtist() { Api api = Api.DEFAULT_API; Request request = api.searchArtists("meeep").build(); - assertEquals("https://api.spotify.com:443/v1/artists/search", request.toString()); + assertEquals("https://api.spotify.com:443/v1/search", request.toString()); assertHasParameter(request.toUrl(), "q", "meeep"); + assertHasParameter(request.toUrl(), "type", "artist"); } @Test public void shouldCreateSearchUrlWithLimitParameter() { Api api = Api.DEFAULT_API; Request request = api.searchTracks("moulat swalf").limit(2).build(); - assertEquals("https://api.spotify.com:443/v1/tracks/search", request.toString()); + assertEquals("https://api.spotify.com:443/v1/search", request.toString()); assertHasParameter(request.toUrl(), "q", "moulat+swalf"); assertHasParameter(request.toUrl(), "limit", "2"); + assertHasParameter(request.toUrl(), "type", "track"); } @Test public void shouldCreateSearchUrlWithOffsetParameter() { Api api = Api.DEFAULT_API; Request request = api.searchTracks("moulat swalf").offset(2).build(); - assertEquals("https://api.spotify.com:443/v1/tracks/search", request.toString()); + assertEquals("https://api.spotify.com:443/v1/search", request.toString()); assertHasParameter(request.toUrl(), "q", "moulat+swalf"); assertHasParameter(request.toUrl(), "offset", "2"); + assertHasParameter(request.toUrl(), "type", "track"); } @Test @@ -194,7 +215,7 @@ public void shouldCreateUserProfileUrl() { assertEquals("https://api.spotify.com:443/v1/users/wizzler", request.toString()); } - void assertHasParameter(Url url, String name, Object value) { + private void assertHasParameter(Url url, String name, Object value) { Parameter expected = Parameter.newBuilder().setName(name).setValue(value.toString()).build(); for (Parameter actual : url.getParametersList()) { if (actual.equals(expected)) { @@ -204,4 +225,12 @@ void assertHasParameter(Url url, String name, Object value) { fail(String.format("Actual URL %s does not contain parameter %s", url, expected)); } + private void assertNoParameter(Url url, String name) { + for (Parameter actual : url.getParametersList()) { + if (actual.getName().equals(name)) { + fail(String.format("Actual URL %s contains parameter %s", url, name)); + } + } + } + } From 741a61c3a0a4fbfbc776df513598abee66f3b5c5 Mon Sep 17 00:00:00 2001 From: Michael Thelin Date: Fri, 16 May 2014 18:40:16 +0200 Subject: [PATCH 02/10] Update object model --- .../se/michaelthelin/spotify/JsonUtil.java | 43 +- .../spotify/methods/AlbumSearchRequest.java | 11 +- .../methods/AlbumsForArtistRequest.java | 11 +- .../michaelthelin/spotify/models/Album.java | 6 +- .../spotify/models/Followers.java | 15 + .../spotify/models/Playlist.java | 20 +- .../spotify/models/PlaylistTrack.java | 34 + .../models/PlaylistTracksInformation.java | 23 + .../spotify/models/SimplePlaylist.java | 95 ++ src/test/fixtures/album.json | 441 +++++-- src/test/fixtures/albums.json | 1080 +++++++++++++++-- src/test/fixtures/search-album.json | 622 +--------- src/test/fixtures/search-artist.json | 68 +- src/test/fixtures/search-track-page1.json | 657 +++++++++- src/test/fixtures/search-track.json | 656 ++++++++++ .../methods/AlbumSearchRequestTest.java | 21 +- .../methods/AlbumsForArtistsRequestTest.java | 21 +- .../methods/TrackSearchRequestTest.java | 16 +- 18 files changed, 2955 insertions(+), 885 deletions(-) create mode 100644 src/main/java/se/michaelthelin/spotify/models/Followers.java create mode 100644 src/main/java/se/michaelthelin/spotify/models/PlaylistTrack.java create mode 100644 src/main/java/se/michaelthelin/spotify/models/PlaylistTracksInformation.java create mode 100644 src/main/java/se/michaelthelin/spotify/models/SimplePlaylist.java create mode 100644 src/test/fixtures/search-track.json diff --git a/src/main/java/se/michaelthelin/spotify/JsonUtil.java b/src/main/java/se/michaelthelin/spotify/JsonUtil.java index 9541e27cb..a41cffaa4 100644 --- a/src/main/java/se/michaelthelin/spotify/JsonUtil.java +++ b/src/main/java/se/michaelthelin/spotify/JsonUtil.java @@ -116,7 +116,7 @@ private static Album createAlbum(JSONObject albumJson) { album.setName(albumJson.getString("name")); album.setPopularity(albumJson.getInt("popularity")); album.setReleaseDate(createReleaseDate(albumJson.getJSONObject("release_date"))); - album.setTracks(createSimpleTracks(albumJson.getJSONArray("tracks"))); + album.setTracks(createSimpleTrackPage(albumJson)); album.setType(createSpotifyEntityType(albumJson.getString("type"))); album.setUri(albumJson.getString("uri")); @@ -154,11 +154,11 @@ public static ReleaseDate createReleaseDate(JSONObject releaseDateJson) { ReleaseDate releaseDate = new ReleaseDate(); releaseDate.setYear(releaseDateJson.getInt("year")); - if (!releaseDateJson.getJSONObject("month").isNullObject()) { + if (releaseDateJson.has("month") && !releaseDateJson.get("month").equals("null")) { releaseDate.setMonth(releaseDateJson.getInt("month")); } - if (!releaseDateJson.getJSONObject("date").isNullObject()) { + if (releaseDateJson.has("date") && !releaseDateJson.get("date").equals("null")) { releaseDate.setDate(releaseDateJson.getInt("date")); } @@ -211,6 +211,14 @@ public static List createAlbums(JSONArray jsonArray) { return returnedAlbums; } + public static List createSimpleAlbums(JSONArray jsonArray) { + List returnedAlbums = new ArrayList(); + for (int i = 0; i < jsonArray.size(); i++) { + returnedAlbums.add(createSimpleAlbum(jsonArray.getJSONObject(i))); + } + return returnedAlbums; + } + public static SimpleArtist createSimpleArtist(JSONObject simpleArtistJson) { if (simpleArtistJson == null || simpleArtistJson.isNullObject()) { return null; @@ -303,8 +311,8 @@ public static Page createAlbumPage(String albumPageJson) { } public static Page createAlbumPage(JSONObject albumPageJson) { - Page page = createItemlessPage(albumPageJson); - page.setItems(createAlbums(albumPageJson.getJSONArray("items"))); + Page page = createItemlessPage(albumPageJson.getJSONObject("albums")); + page.setItems(createAlbums(albumPageJson.getJSONObject("albums").getJSONArray("items"))); return page; } @@ -328,8 +336,8 @@ public static Page createTrackPage(String trackPageJson) { } public static Page createTrackPage(JSONObject trackPageJson) { - Page page = createItemlessPage(trackPageJson); - page.setItems(createTracks(trackPageJson.getJSONArray("items"))); + Page page = createItemlessPage(trackPageJson.getJSONObject("tracks")); + page.setItems(createTracks(trackPageJson.getJSONObject("tracks").getJSONArray("items"))); return page; } @@ -338,8 +346,24 @@ public static Page createArtistPage(String artistPageJson) { } public static Page createArtistPage(JSONObject artistPageJson) { - Page page = createItemlessPage(artistPageJson); - page.setItems(createArtists(artistPageJson.getJSONArray("items"))); + Page page = createItemlessPage(artistPageJson.getJSONObject("artists")); + page.setItems(createArtists(artistPageJson.getJSONObject("artists").getJSONArray("items"))); + return page; + } + + private static Page createSimpleTrackPage(JSONObject simpleTrackPageJson) { + Page page = createItemlessPage(simpleTrackPageJson.getJSONObject("tracks")); + page.setItems(createSimpleTracks(simpleTrackPageJson.getJSONObject("tracks").getJSONArray("items"))); + return page; + } + + public static Page createSimpleAlbumPage(String simpleAlbumPageJson) { + return createSimpleAlbumPage(JSONObject.fromObject(simpleAlbumPageJson)); + } + + public static Page createSimpleAlbumPage(JSONObject simpleAlbumPageJson) { + Page page = createItemlessPage(simpleAlbumPageJson.getJSONObject("albums")); + page.setItems(createSimpleAlbums(simpleAlbumPageJson.getJSONObject("albums").getJSONArray("items"))); return page; } @@ -376,4 +400,5 @@ public static User createUser(JSONObject userJson) { private static Product createProduct(String product) { return Product.valueOf(product.toUpperCase()); } + } diff --git a/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java b/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java index ac61747c8..70a374e8e 100644 --- a/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java +++ b/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java @@ -6,6 +6,7 @@ import se.michaelthelin.spotify.exceptions.UnexpectedResponseException; import se.michaelthelin.spotify.models.Album; import se.michaelthelin.spotify.models.Page; +import se.michaelthelin.spotify.models.SimpleAlbum; import java.io.IOException; @@ -15,13 +16,13 @@ protected AlbumSearchRequest(Builder builder) { super(builder); } - public SettableFuture> getAlbumsPageAsync() { - SettableFuture> searchResultFuture = SettableFuture.create(); + public SettableFuture> getAsync() { + SettableFuture> searchResultFuture = SettableFuture.create(); try { String jsonString = getJson(); JSONObject jsonObject = JSONObject.fromObject(jsonString); - searchResultFuture.set(JsonUtil.createAlbumPage(jsonObject)); + searchResultFuture.set(JsonUtil.createSimpleAlbumPage(jsonObject)); } catch (IOException e) { searchResultFuture.setException(e); } catch (UnexpectedResponseException e) { @@ -31,8 +32,8 @@ public SettableFuture> getAlbumsPageAsync() { return searchResultFuture; } - public Page getAlbumsPage() throws IOException, UnexpectedResponseException { - return JsonUtil.createAlbumPage(getJson()); + public Page getPage() throws IOException, UnexpectedResponseException { + return JsonUtil.createSimpleAlbumPage(getJson()); } public static Builder builder() { diff --git a/src/main/java/se/michaelthelin/spotify/methods/AlbumsForArtistRequest.java b/src/main/java/se/michaelthelin/spotify/methods/AlbumsForArtistRequest.java index f3b3b2efa..99fdfbb9f 100644 --- a/src/main/java/se/michaelthelin/spotify/methods/AlbumsForArtistRequest.java +++ b/src/main/java/se/michaelthelin/spotify/methods/AlbumsForArtistRequest.java @@ -10,6 +10,7 @@ import se.michaelthelin.spotify.models.Album; import se.michaelthelin.spotify.models.AlbumType; import se.michaelthelin.spotify.models.Page; +import se.michaelthelin.spotify.models.SimpleAlbum; import java.io.IOException; @@ -19,13 +20,13 @@ public AlbumsForArtistRequest(Builder builder) { super(builder); } - public SettableFuture> getAsync() { - SettableFuture> searchResultFuture = SettableFuture.create(); + public SettableFuture> getAsync() { + SettableFuture> searchResultFuture = SettableFuture.create(); try { String jsonString = getJson(); JSONObject jsonObject = JSONObject.fromObject(jsonString); - searchResultFuture.set(JsonUtil.createAlbumPage(jsonObject)); + searchResultFuture.set(JsonUtil.createSimpleAlbumPage(jsonObject)); } catch (IOException e) { searchResultFuture.setException(e); } catch (UnexpectedResponseException e) { @@ -35,8 +36,8 @@ public SettableFuture> getAsync() { return searchResultFuture; } - public Page get() throws IOException, UnexpectedResponseException, NotFoundException, BadFieldException { - return JsonUtil.createAlbumPage(getJson()); + public Page get() throws IOException, UnexpectedResponseException, NotFoundException, BadFieldException { + return JsonUtil.createSimpleAlbumPage(getJson()); } public static Builder builder() { diff --git a/src/main/java/se/michaelthelin/spotify/models/Album.java b/src/main/java/se/michaelthelin/spotify/models/Album.java index 2cf0847a0..3f7b9c8c4 100644 --- a/src/main/java/se/michaelthelin/spotify/models/Album.java +++ b/src/main/java/se/michaelthelin/spotify/models/Album.java @@ -16,7 +16,7 @@ public class Album { private String name; private int popularity; private ReleaseDate releaseDate; - private List tracks; + private Page tracks; private SpotifyEntityType type = SpotifyEntityType.ALBUM; private String uri; @@ -116,11 +116,11 @@ public void setReleaseDate(ReleaseDate releaseDate) { this.releaseDate = releaseDate; } - public List getTracks() { + public Page getTracks() { return tracks; } - public void setTracks(List tracks) { + public void setTracks(Page tracks) { this.tracks = tracks; } diff --git a/src/main/java/se/michaelthelin/spotify/models/Followers.java b/src/main/java/se/michaelthelin/spotify/models/Followers.java new file mode 100644 index 000000000..adcade05a --- /dev/null +++ b/src/main/java/se/michaelthelin/spotify/models/Followers.java @@ -0,0 +1,15 @@ +package se.michaelthelin.spotify.models; + +public class Followers { + + private String href; + private int total; + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } +} diff --git a/src/main/java/se/michaelthelin/spotify/models/Playlist.java b/src/main/java/se/michaelthelin/spotify/models/Playlist.java index 43721b890..e2ae30216 100644 --- a/src/main/java/se/michaelthelin/spotify/models/Playlist.java +++ b/src/main/java/se/michaelthelin/spotify/models/Playlist.java @@ -7,14 +7,14 @@ public class Playlist { private boolean collaborative; private String description; private ExternalUrls externalUrls; - private int followersCount; + private Followers followers; private String href; private String id; private List images; private User owner; private String name; private boolean publicAccess; - private int tracksCount; + private Page tracks; private SpotifyEntityType type = SpotifyEntityType.PLAYLIST; private String uri; @@ -42,12 +42,12 @@ public void setExternalUrls(ExternalUrls externalUrls) { this.externalUrls = externalUrls; } - public int getFollowersCount() { - return followersCount; + public Followers getFollowers() { + return followers; } - public void setFollowersCount(int followersCount) { - this.followersCount = followersCount; + public void setFollowers(Followers followers) { + this.followers = followers; } public String getHref() { @@ -90,14 +90,6 @@ public void setName(String name) { this.name = name; } - public int getTracksCount() { - return tracksCount; - } - - public void setTracksCount(int tracksCount) { - this.tracksCount = tracksCount; - } - public SpotifyEntityType getType() { return type; } diff --git a/src/main/java/se/michaelthelin/spotify/models/PlaylistTrack.java b/src/main/java/se/michaelthelin/spotify/models/PlaylistTrack.java new file mode 100644 index 000000000..ed2e01a25 --- /dev/null +++ b/src/main/java/se/michaelthelin/spotify/models/PlaylistTrack.java @@ -0,0 +1,34 @@ +package se.michaelthelin.spotify.models; + +import java.util.Date; + +public class PlaylistTrack { + + private Date addedAt; + private User addedBy; + private SimpleTrack track; + + public Date getAddedAt() { + return addedAt; + } + + public void setAddedAt(Date addedAt) { + this.addedAt = addedAt; + } + + public User getAddedBy() { + return addedBy; + } + + public void setAddedBy(User addedBy) { + this.addedBy = addedBy; + } + + public SimpleTrack getTrack() { + return track; + } + + public void setTrack(SimpleTrack track) { + this.track = track; + } +} diff --git a/src/main/java/se/michaelthelin/spotify/models/PlaylistTracksInformation.java b/src/main/java/se/michaelthelin/spotify/models/PlaylistTracksInformation.java new file mode 100644 index 000000000..c0fa416c4 --- /dev/null +++ b/src/main/java/se/michaelthelin/spotify/models/PlaylistTracksInformation.java @@ -0,0 +1,23 @@ +package se.michaelthelin.spotify.models; + +public class PlaylistTracksInformation { + + private String href; + private int total; + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } +} diff --git a/src/main/java/se/michaelthelin/spotify/models/SimplePlaylist.java b/src/main/java/se/michaelthelin/spotify/models/SimplePlaylist.java new file mode 100644 index 000000000..7681d082f --- /dev/null +++ b/src/main/java/se/michaelthelin/spotify/models/SimplePlaylist.java @@ -0,0 +1,95 @@ +package se.michaelthelin.spotify.models; + +public class SimplePlaylist { + + private boolean collaborative; + private ExternalUrls externalUrls; + private String href; + private String id; + private User owner; + private String name; + private boolean publicAccess; + private PlaylistTracksInformation tracks; + private SpotifyEntityType type = SpotifyEntityType.PLAYLIST; + private String uri; + + public boolean isCollaborative() { + return collaborative; + } + + public void setCollaborative(boolean collaborative) { + this.collaborative = collaborative; + } + + public ExternalUrls getExternalUrls() { + return externalUrls; + } + + public void setExternalUrls(ExternalUrls externalUrls) { + this.externalUrls = externalUrls; + } + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public User getOwner() { + return owner; + } + + public void setOwner(User owner) { + this.owner = owner; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public boolean isPublicAccess() { + return publicAccess; + } + + public void setPublicAccess(boolean publicAccess) { + this.publicAccess = publicAccess; + } + + public PlaylistTracksInformation getTracks() { + return tracks; + } + + public void setTracks(PlaylistTracksInformation tracks) { + this.tracks = tracks; + } + + public SpotifyEntityType getType() { + return type; + } + + public void setType(SpotifyEntityType type) { + this.type = type; + } + + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } +} diff --git a/src/test/fixtures/album.json b/src/test/fixtures/album.json index aa2abbf1b..5914a5cfa 100644 --- a/src/test/fixtures/album.json +++ b/src/test/fixtures/album.json @@ -1,85 +1,366 @@ { - "album_type": "album", - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" - }, - "href": "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", - "id": "2BTZIqw0ntH9MvilQ3ewNY", - "name": "Cyndi Lauper", - "type": "artist", - "uri": "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" - } - ], - "available_markets": [ - "AD", - "AR", - "TW", - "UY" - ], - "external_ids": { - "upc": "5099749994324" + "album_type" : "album", + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" }, - "external_urls": { - "spotify": "https://open.spotify.com/album/0sNOF9WDwhWunNAHPD3Baj" - }, - "genres": [], - "href": "https://api.spotify.com/v1/albums/0sNOF9WDwhWunNAHPD3Baj", - "id": "0sNOF9WDwhWunNAHPD3Baj", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/07c323340e03e25a8e5dd5b9a8ec72b69c50089d", - "width": 640 + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TW", "UY" ], + "external_ids" : { + "upc" : "5099749994324" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/album/0sNOF9WDwhWunNAHPD3Baj" + }, + "genres" : [ ], + "href" : "https://api.spotify.com/v1/albums/0sNOF9WDwhWunNAHPD3Baj", + "id" : "0sNOF9WDwhWunNAHPD3Baj", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/07c323340e03e25a8e5dd5b9a8ec72b69c50089d", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8b662d81966a0ec40dc10563807696a8479cd48b", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/54b3222c8aaa77890d1ac37b3aaaa1fc9ba630ae", + "width" : 64 + } ], + "name" : "She's So Unusual", + "popularity" : 38, + "release_date" : { + "day" : null, + "month" : null, + "year" : 1983 + }, + "tracks" : { + "href" : "https://api.spotify.com/v1/albums/0sNOF9WDwhWunNAHPD3Baj/tracks?offset=0&limit=50", + "items" : [ { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/8b662d81966a0ec40dc10563807696a8479cd48b", - "width": 300 + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 305560, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/3f9zqUnrnIq0LANhmnaF0V" + }, + "href" : "https://api.spotify.com/v1/tracks/3f9zqUnrnIq0LANhmnaF0V", + "id" : "3f9zqUnrnIq0LANhmnaF0V", + "name" : "Money Changes Everything", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/01bb2a6c9a89c05a4300aea427241b1719a26b06", + "track_number" : 1, + "type" : "track", + "uri" : "spotify:track:3f9zqUnrnIq0LANhmnaF0V" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/54b3222c8aaa77890d1ac37b3aaaa1fc9ba630ae", - "width": 64 - } - ], - "name": "She's So Unusual", - "popularity": 33, - "release_date": { - "day": null, - "month": null, - "year": 1983 - }, - "tracks": [ - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" - }, - "href": "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", - "id": "2BTZIqw0ntH9MvilQ3ewNY", - "name": "Cyndi Lauper", - "type": "artist", - "uri": "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" - } - ], - "disc_number": 1, - "duration_ms": 305560, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/3f9zqUnrnIq0LANhmnaF0V" - }, - "href": "https://api.spotify.com/v1/tracks/3f9zqUnrnIq0LANhmnaF0V", - "id": "3f9zqUnrnIq0LANhmnaF0V", - "name": "Money Changes Everything", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/01bb2a6c9a89c05a4300aea427241b1719a26b06", - "track_number": 1, - "type": "track", - "uri": "spotify:track:3f9zqUnrnIq0LANhmnaF0V" - } - ], - "type": "album", - "uri": "spotify:album:0sNOF9WDwhWunNAHPD3Baj" + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 238266, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2joHDtKFVDDyWDHnOxZMAX" + }, + "href" : "https://api.spotify.com/v1/tracks/2joHDtKFVDDyWDHnOxZMAX", + "id" : "2joHDtKFVDDyWDHnOxZMAX", + "name" : "Girls Just Want to Have Fun", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/4fb5dfb0f1d60d23d1072548847e26906951ead9", + "track_number" : 2, + "type" : "track", + "uri" : "spotify:track:2joHDtKFVDDyWDHnOxZMAX" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" + }, + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 306706, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/6ClztHzretmPHCeiNqR5wD" + }, + "href" : "https://api.spotify.com/v1/tracks/6ClztHzretmPHCeiNqR5wD", + "id" : "6ClztHzretmPHCeiNqR5wD", + "name" : "When You Were Mine", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/7ce74522fabed32d7310084541bf38f906bb33bc", + "track_number" : 3, + "type" : "track", + "uri" : "spotify:track:6ClztHzretmPHCeiNqR5wD" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" + }, + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 241333, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2tVHvZK4YYzTloSCBPm2tg" + }, + "href" : "https://api.spotify.com/v1/tracks/2tVHvZK4YYzTloSCBPm2tg", + "id" : "2tVHvZK4YYzTloSCBPm2tg", + "name" : "Time After Time", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/0b0b522f1412996c5c0c8d44f886d76d43f33f6c", + "track_number" : 4, + "type" : "track", + "uri" : "spotify:track:2tVHvZK4YYzTloSCBPm2tg" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" + }, + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 229266, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/6iLhMDtOr52OVXaZdha5M6" + }, + "href" : "https://api.spotify.com/v1/tracks/6iLhMDtOr52OVXaZdha5M6", + "id" : "6iLhMDtOr52OVXaZdha5M6", + "name" : "She Bop", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/95bbe8eb0ea9d64c8bed6a95a0484250068ffd57", + "track_number" : 5, + "type" : "track", + "uri" : "spotify:track:6iLhMDtOr52OVXaZdha5M6" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" + }, + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 272840, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/3csiLr2B2wRj4lsExn6jLf" + }, + "href" : "https://api.spotify.com/v1/tracks/3csiLr2B2wRj4lsExn6jLf", + "id" : "3csiLr2B2wRj4lsExn6jLf", + "name" : "All Through the Night", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/e2dfc024cc4653ecc07f9c9e14fd882f8150cdb7", + "track_number" : 6, + "type" : "track", + "uri" : "spotify:track:3csiLr2B2wRj4lsExn6jLf" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" + }, + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 220333, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/4mRAnuBGYsW4WGbpW0QUkp" + }, + "href" : "https://api.spotify.com/v1/tracks/4mRAnuBGYsW4WGbpW0QUkp", + "id" : "4mRAnuBGYsW4WGbpW0QUkp", + "name" : "Witness", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/9be78ca9a07914db151f1e970c068970769d2731", + "track_number" : 7, + "type" : "track", + "uri" : "spotify:track:4mRAnuBGYsW4WGbpW0QUkp" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" + }, + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 252626, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/3AIeUnffkLQaUaX1pkHyeD" + }, + "href" : "https://api.spotify.com/v1/tracks/3AIeUnffkLQaUaX1pkHyeD", + "id" : "3AIeUnffkLQaUaX1pkHyeD", + "name" : "I'll Kiss You", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/9031f915fbe2d62cbac7e22eb4e17c69bbcc72b8", + "track_number" : 8, + "type" : "track", + "uri" : "spotify:track:3AIeUnffkLQaUaX1pkHyeD" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" + }, + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 45933, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/53eCpAFNbA9MQNfLilN3CH" + }, + "href" : "https://api.spotify.com/v1/tracks/53eCpAFNbA9MQNfLilN3CH", + "id" : "53eCpAFNbA9MQNfLilN3CH", + "name" : "He's so Unusual", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/3b86ffe73440aeb1dca36ab9edb4245e0d7124c7", + "track_number" : 9, + "type" : "track", + "uri" : "spotify:track:53eCpAFNbA9MQNfLilN3CH" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" + }, + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 196373, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/51JS0KXziu9U1T8EBdRTUF" + }, + "href" : "https://api.spotify.com/v1/tracks/51JS0KXziu9U1T8EBdRTUF", + "id" : "51JS0KXziu9U1T8EBdRTUF", + "name" : "Yeah Yeah", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/113b4d4b560cddd344fe9ea7d3704d8f8f1600a5", + "track_number" : 10, + "type" : "track", + "uri" : "spotify:track:51JS0KXziu9U1T8EBdRTUF" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" + }, + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 275560, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2BGJvRarwOa2kiIGpLjIXT" + }, + "href" : "https://api.spotify.com/v1/tracks/2BGJvRarwOa2kiIGpLjIXT", + "id" : "2BGJvRarwOa2kiIGpLjIXT", + "name" : "Money Changes Everything", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/76ac67ccd4f27eb0deaf9d789436def22def2304", + "track_number" : 11, + "type" : "track", + "uri" : "spotify:track:2BGJvRarwOa2kiIGpLjIXT" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" + }, + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 320400, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5ggatiDTbCIJsUAa7IUP65" + }, + "href" : "https://api.spotify.com/v1/tracks/5ggatiDTbCIJsUAa7IUP65", + "id" : "5ggatiDTbCIJsUAa7IUP65", + "name" : "She Bop - Live", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/ea6b57b35d2bcf5caddc7e6e3655fc3215eec8a4", + "track_number" : 12, + "type" : "track", + "uri" : "spotify:track:5ggatiDTbCIJsUAa7IUP65" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/2BTZIqw0ntH9MvilQ3ewNY" + }, + "href" : "https://api.spotify.com/v1/artists/2BTZIqw0ntH9MvilQ3ewNY", + "id" : "2BTZIqw0ntH9MvilQ3ewNY", + "name" : "Cyndi Lauper", + "type" : "artist", + "uri" : "spotify:artist:2BTZIqw0ntH9MvilQ3ewNY" + } ], + "disc_number" : 1, + "duration_ms" : 288240, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5ZBxoa2kBrBah3qNIV4rm7" + }, + "href" : "https://api.spotify.com/v1/tracks/5ZBxoa2kBrBah3qNIV4rm7", + "id" : "5ZBxoa2kBrBah3qNIV4rm7", + "name" : "All Through The Night - Live", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/cc8d13b1ce2e41f915a126bc6723a9cf7c491e08", + "track_number" : 13, + "type" : "track", + "uri" : "spotify:track:5ZBxoa2kBrBah3qNIV4rm7" + } ], + "limit" : 50, + "next" : null, + "offset" : 0, + "previous" : null, + "total" : 13 + }, + "type" : "album", + "uri" : "spotify:album:0sNOF9WDwhWunNAHPD3Baj" } \ No newline at end of file diff --git a/src/test/fixtures/albums.json b/src/test/fixtures/albums.json index 6ee84a2d4..5dde7f8fb 100644 --- a/src/test/fixtures/albums.json +++ b/src/test/fixtures/albums.json @@ -1,116 +1,968 @@ { - "albums": [ - { - "album_type": "album", - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" - }, - "href": "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", - "id": "53A0W3U0s8diEn9RhXQhVz", - "name": "Keane", - "type": "artist", - "uri": "spotify:artist:53A0W3U0s8diEn9RhXQhVz" - } - ], - "available_markets": [ - "AD", - "AR", - "TW", - "UY" - ], - "external_ids": { - "upc": "00602537518357" - }, - "external_urls": { - "spotify": "https://open.spotify.com/album/41MnTivkwTO3UUJ8DrqEJJ" - }, - "genres": [], - "href": "https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ", - "id": "41MnTivkwTO3UUJ8DrqEJJ", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/89b92c6b59131776c0cd8e5df46301ffcf36ed69", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/eb6f0b2594d81f8d9dced193f3e9a3bc4318aedc", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/21e1ebcd7ebd3b679d9d5084bba1e163638b103a", - "width": 64 - } - ], - "name": "The Best Of Keane (Deluxe)", - "popularity": 73, - "release_date": { - "day": null, - "month": null, - "year": 2013 - }, - "tracks": [ - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" - }, - "href": "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", - "id": "53A0W3U0s8diEn9RhXQhVz", - "name": "Keane", - "type": "artist", - "uri": "spotify:artist:53A0W3U0s8diEn9RhXQhVz" - } - ], - "disc_number": 1, - "duration_ms": 215986, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/4r9PmSmbAOOWqaGWLf6M9Q" - }, - "href": "https://api.spotify.com/v1/tracks/4r9PmSmbAOOWqaGWLf6M9Q", - "id": "4r9PmSmbAOOWqaGWLf6M9Q", - "name": "Everybody's Changing", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/641fd877ee0f42f3713d1649e20a9734cc64b8f9", - "track_number": 1, - "type": "track", - "uri": "spotify:track:4r9PmSmbAOOWqaGWLf6M9Q" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" - }, - "href": "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", - "id": "53A0W3U0s8diEn9RhXQhVz", - "name": "Keane", - "type": "artist", - "uri": "spotify:artist:53A0W3U0s8diEn9RhXQhVz" - } - ], - "disc_number": 1, - "duration_ms": 235880, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/0HJQD8uqX2Bq5HVdLnd3ep" - }, - "href": "https://api.spotify.com/v1/tracks/0HJQD8uqX2Bq5HVdLnd3ep", - "id": "0HJQD8uqX2Bq5HVdLnd3ep", - "name": "Somewhere Only We Know", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/e001676375ea2b4807cee2f98b51f2f3fe0d109b", - "track_number": 2, - "type": "track", - "uri": "spotify:track:0HJQD8uqX2Bq5HVdLnd3ep" - } - ], - "type": "album", - "uri": "spotify:album:41MnTivkwTO3UUJ8DrqEJJ" - } - ] + "albums" : [ { + "album_type" : "album", + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "UY" ], + "external_ids" : { + "upc" : "00602537518357" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/album/41MnTivkwTO3UUJ8DrqEJJ" + }, + "genres" : [ ], + "href" : "https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ", + "id" : "41MnTivkwTO3UUJ8DrqEJJ", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/89b92c6b59131776c0cd8e5df46301ffcf36ed69", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/eb6f0b2594d81f8d9dced193f3e9a3bc4318aedc", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/21e1ebcd7ebd3b679d9d5084bba1e163638b103a", + "width" : 64 + } ], + "name" : "The Best Of Keane (Deluxe Edition)", + "popularity" : 72, + "release_date" : { + "day" : 8, + "month" : 11, + "year" : 2013 + }, + "tracks" : { + "href" : "https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=0&limit=50", + "items" : [ { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 215986, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/4r9PmSmbAOOWqaGWLf6M9Q" + }, + "href" : "https://api.spotify.com/v1/tracks/4r9PmSmbAOOWqaGWLf6M9Q", + "id" : "4r9PmSmbAOOWqaGWLf6M9Q", + "name" : "Everybody's Changing", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/641fd877ee0f42f3713d1649e20a9734cc64b8f9", + "track_number" : 1, + "type" : "track", + "uri" : "spotify:track:4r9PmSmbAOOWqaGWLf6M9Q" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 235880, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/0HJQD8uqX2Bq5HVdLnd3ep" + }, + "href" : "https://api.spotify.com/v1/tracks/0HJQD8uqX2Bq5HVdLnd3ep", + "id" : "0HJQD8uqX2Bq5HVdLnd3ep", + "name" : "Somewhere Only We Know", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/e001676375ea2b4807cee2f98b51f2f3fe0d109b", + "track_number" : 2, + "type" : "track", + "uri" : "spotify:track:0HJQD8uqX2Bq5HVdLnd3ep" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 218426, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/087AcwkqBIuIebZWpwbOI4" + }, + "href" : "https://api.spotify.com/v1/tracks/087AcwkqBIuIebZWpwbOI4", + "id" : "087AcwkqBIuIebZWpwbOI4", + "name" : "Bend & Break", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/749a221aee9b644696188c108a650587bb092083", + "track_number" : 3, + "type" : "track", + "uri" : "spotify:track:087AcwkqBIuIebZWpwbOI4" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 275093, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5s2TY4v3WTECwelIqqqtuS" + }, + "href" : "https://api.spotify.com/v1/tracks/5s2TY4v3WTECwelIqqqtuS", + "id" : "5s2TY4v3WTECwelIqqqtuS", + "name" : "Bedshaped", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/c38bc16f2908c66d4433c1d8ecf561b9e011ad7e", + "track_number" : 4, + "type" : "track", + "uri" : "spotify:track:5s2TY4v3WTECwelIqqqtuS" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 207653, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5Q9h1xA3xqUJyx1dDlq6MI" + }, + "href" : "https://api.spotify.com/v1/tracks/5Q9h1xA3xqUJyx1dDlq6MI", + "id" : "5Q9h1xA3xqUJyx1dDlq6MI", + "name" : "This Is The Last Time", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/7773802cefc9075b866e237c1e9f83d474a23d92", + "track_number" : 5, + "type" : "track", + "uri" : "spotify:track:5Q9h1xA3xqUJyx1dDlq6MI" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 250786, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/0BIpP7vmh35JEpT1zkv7Sl" + }, + "href" : "https://api.spotify.com/v1/tracks/0BIpP7vmh35JEpT1zkv7Sl", + "id" : "0BIpP7vmh35JEpT1zkv7Sl", + "name" : "Atlantic", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/5fb9783e0b98384214fb4afbe85559314acbc658", + "track_number" : 6, + "type" : "track", + "uri" : "spotify:track:0BIpP7vmh35JEpT1zkv7Sl" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 185813, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/64rOSkztPrTECtWTB0F2OD" + }, + "href" : "https://api.spotify.com/v1/tracks/64rOSkztPrTECtWTB0F2OD", + "id" : "64rOSkztPrTECtWTB0F2OD", + "name" : "Is It Any Wonder?", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/940ab2e86b9a5d489d5d8962678a704308701db6", + "track_number" : 7, + "type" : "track", + "uri" : "spotify:track:64rOSkztPrTECtWTB0F2OD" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 239986, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5XulFHMk0X9foui8If85qV" + }, + "href" : "https://api.spotify.com/v1/tracks/5XulFHMk0X9foui8If85qV", + "id" : "5XulFHMk0X9foui8If85qV", + "name" : "Nothing In My Way", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/aadbd2a6e7054202c028460fd00171c4487d11b7", + "track_number" : 8, + "type" : "track", + "uri" : "spotify:track:5XulFHMk0X9foui8If85qV" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 277360, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/7EbeyS7knwgd3TtJepU1On" + }, + "href" : "https://api.spotify.com/v1/tracks/7EbeyS7knwgd3TtJepU1On", + "id" : "7EbeyS7knwgd3TtJepU1On", + "name" : "Hamburg Song", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/24ef48ff72f71dd01d4ff4eafe47c9dafc038dda", + "track_number" : 9, + "type" : "track", + "uri" : "spotify:track:7EbeyS7knwgd3TtJepU1On" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 233520, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5faIME3g9Lxo4Myf8ArY9l" + }, + "href" : "https://api.spotify.com/v1/tracks/5faIME3g9Lxo4Myf8ArY9l", + "id" : "5faIME3g9Lxo4Myf8ArY9l", + "name" : "Crystal Ball", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/c98b717e56458474d7e4f109c6c3cc5e59366c3b", + "track_number" : 10, + "type" : "track", + "uri" : "spotify:track:5faIME3g9Lxo4Myf8ArY9l" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 302813, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/3dkTbaMEfF8mqCNSSZKB5S" + }, + "href" : "https://api.spotify.com/v1/tracks/3dkTbaMEfF8mqCNSSZKB5S", + "id" : "3dkTbaMEfF8mqCNSSZKB5S", + "name" : "A Bad Dream", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/85fe984a8c4ebdf567b4df9271a83718e2c92b89", + "track_number" : 11, + "type" : "track", + "uri" : "spotify:track:3dkTbaMEfF8mqCNSSZKB5S" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 267320, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/38zl5v3L94wzbl3iQHAxNM" + }, + "href" : "https://api.spotify.com/v1/tracks/38zl5v3L94wzbl3iQHAxNM", + "id" : "38zl5v3L94wzbl3iQHAxNM", + "name" : "Try Again", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/4a866e97e195e5fb8eeea693f741089635988065", + "track_number" : 12, + "type" : "track", + "uri" : "spotify:track:38zl5v3L94wzbl3iQHAxNM" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 204013, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/1K4SP6flGBk73cgshPqDCp" + }, + "href" : "https://api.spotify.com/v1/tracks/1K4SP6flGBk73cgshPqDCp", + "id" : "1K4SP6flGBk73cgshPqDCp", + "name" : "Spiralling", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/5092d122cfb0984098654b2933ab7101e217f43a", + "track_number" : 13, + "type" : "track", + "uri" : "spotify:track:1K4SP6flGBk73cgshPqDCp" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 311533, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/7DNKgwHgPgbGhqdXJGkxf6" + }, + "href" : "https://api.spotify.com/v1/tracks/7DNKgwHgPgbGhqdXJGkxf6", + "id" : "7DNKgwHgPgbGhqdXJGkxf6", + "name" : "Perfect Symmetry", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/d81eda54420ff4de3e2b8dd830369bbfd48b0440", + "track_number" : 14, + "type" : "track", + "uri" : "spotify:track:7DNKgwHgPgbGhqdXJGkxf6" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 289386, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/3CFNKsHlpAleVotCDI78ca" + }, + "href" : "https://api.spotify.com/v1/tracks/3CFNKsHlpAleVotCDI78ca", + "id" : "3CFNKsHlpAleVotCDI78ca", + "name" : "My Shadow", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/3543ac4228b4fe1f9548809122d042a642370cb2", + "track_number" : 15, + "type" : "track", + "uri" : "spotify:track:3CFNKsHlpAleVotCDI78ca" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 196333, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5OVyLOs64kq6zL12QrQD6o" + }, + "href" : "https://api.spotify.com/v1/tracks/5OVyLOs64kq6zL12QrQD6o", + "id" : "5OVyLOs64kq6zL12QrQD6o", + "name" : "Silenced By The Night", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/4684636237afc6076ad7387f9577c75775b5153f", + "track_number" : 16, + "type" : "track", + "uri" : "spotify:track:5OVyLOs64kq6zL12QrQD6o" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 236973, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5AHNNMMn7dApuo4OuqZcPb" + }, + "href" : "https://api.spotify.com/v1/tracks/5AHNNMMn7dApuo4OuqZcPb", + "id" : "5AHNNMMn7dApuo4OuqZcPb", + "name" : "Disconnected", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/076595e9cc8c8880ee036e2f91827d891b5f2e43", + "track_number" : 17, + "type" : "track", + "uri" : "spotify:track:5AHNNMMn7dApuo4OuqZcPb" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 208133, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5wPQMzWTFxKI0Aw3I3OJG6" + }, + "href" : "https://api.spotify.com/v1/tracks/5wPQMzWTFxKI0Aw3I3OJG6", + "id" : "5wPQMzWTFxKI0Aw3I3OJG6", + "name" : "Sovereign Light Café", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/00e944278fdb177456610ac5890f2eb0e5c41dab", + "track_number" : 18, + "type" : "track", + "uri" : "spotify:track:5wPQMzWTFxKI0Aw3I3OJG6" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 201653, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/1Vz9mv3ITvzSxm9sH2pAdn" + }, + "href" : "https://api.spotify.com/v1/tracks/1Vz9mv3ITvzSxm9sH2pAdn", + "id" : "1Vz9mv3ITvzSxm9sH2pAdn", + "name" : "Higher Than The Sun", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/8df32ed474b37184fa71c15e84b7e9aba95bba8f", + "track_number" : 19, + "type" : "track", + "uri" : "spotify:track:1Vz9mv3ITvzSxm9sH2pAdn" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 1, + "duration_ms" : 222426, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/3FYyMnHLaImyLctEoXZolK" + }, + "href" : "https://api.spotify.com/v1/tracks/3FYyMnHLaImyLctEoXZolK", + "id" : "3FYyMnHLaImyLctEoXZolK", + "name" : "Won't Be Broken", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/bab0cc66e713cdf4439ba643b3f5f248ccd6c5bb", + "track_number" : 20, + "type" : "track", + "uri" : "spotify:track:3FYyMnHLaImyLctEoXZolK" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 229533, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/0wnewiCeFaZQKejFECOzS2" + }, + "href" : "https://api.spotify.com/v1/tracks/0wnewiCeFaZQKejFECOzS2", + "id" : "0wnewiCeFaZQKejFECOzS2", + "name" : "Snowed Under", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/5c637d262b607b4f81338ed60afabe84c93018f2", + "track_number" : 1, + "type" : "track", + "uri" : "spotify:track:0wnewiCeFaZQKejFECOzS2" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 217440, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5sqAs4udmaaTWn6xXTpmGL" + }, + "href" : "https://api.spotify.com/v1/tracks/5sqAs4udmaaTWn6xXTpmGL", + "id" : "5sqAs4udmaaTWn6xXTpmGL", + "name" : "Walnut Tree", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/ca4c1a52c7bccaa2a3fb51049234aac07ce7fb3a", + "track_number" : 2, + "type" : "track", + "uri" : "spotify:track:5sqAs4udmaaTWn6xXTpmGL" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 332973, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/1WvLaBfQpk3dv3ciU0we8f" + }, + "href" : "https://api.spotify.com/v1/tracks/1WvLaBfQpk3dv3ciU0we8f", + "id" : "1WvLaBfQpk3dv3ciU0we8f", + "name" : "Fly To Me", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/2b258c9279f4d58d804a7c85b676acf54df4939f", + "track_number" : 3, + "type" : "track", + "uri" : "spotify:track:1WvLaBfQpk3dv3ciU0we8f" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 182733, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/1UBiGrtXAKjc0C7GG937pD" + }, + "href" : "https://api.spotify.com/v1/tracks/1UBiGrtXAKjc0C7GG937pD", + "id" : "1UBiGrtXAKjc0C7GG937pD", + "name" : "To The End Of The Earth", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/63cd6edd2a3abc665bc85972705257a022aab1d9", + "track_number" : 4, + "type" : "track", + "uri" : "spotify:track:1UBiGrtXAKjc0C7GG937pD" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 196826, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/7eNyrwrLzbO8URXaaSU9g1" + }, + "href" : "https://api.spotify.com/v1/tracks/7eNyrwrLzbO8URXaaSU9g1", + "id" : "7eNyrwrLzbO8URXaaSU9g1", + "name" : "The Way You Want It", + "preview_url" : null, + "track_number" : 5, + "type" : "track", + "uri" : "spotify:track:7eNyrwrLzbO8URXaaSU9g1" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 286200, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5JLkkHYBZHUpQKnrIIVhpV" + }, + "href" : "https://api.spotify.com/v1/tracks/5JLkkHYBZHUpQKnrIIVhpV", + "id" : "5JLkkHYBZHUpQKnrIIVhpV", + "name" : "Something In Me Was Dying", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/dcb390edf43db0bc0f946d5d559e1e0635a17096", + "track_number" : 6, + "type" : "track", + "uri" : "spotify:track:5JLkkHYBZHUpQKnrIIVhpV" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 263200, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/6aTi9DrnoLLvVdFSfzUuKP" + }, + "href" : "https://api.spotify.com/v1/tracks/6aTi9DrnoLLvVdFSfzUuKP", + "id" : "6aTi9DrnoLLvVdFSfzUuKP", + "name" : "Allemande", + "preview_url" : null, + "track_number" : 7, + "type" : "track", + "uri" : "spotify:track:6aTi9DrnoLLvVdFSfzUuKP" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 249426, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/1igaBkvf5KZFTsu1fMfDfb" + }, + "href" : "https://api.spotify.com/v1/tracks/1igaBkvf5KZFTsu1fMfDfb", + "id" : "1igaBkvf5KZFTsu1fMfDfb", + "name" : "Let It Slide", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/7e29199a96e249d1f70588a88c9018b185ede4c2", + "track_number" : 8, + "type" : "track", + "uri" : "spotify:track:1igaBkvf5KZFTsu1fMfDfb" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 216200, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/4rCgYClAhCLuf9xD2Y8sI6" + }, + "href" : "https://api.spotify.com/v1/tracks/4rCgYClAhCLuf9xD2Y8sI6", + "id" : "4rCgYClAhCLuf9xD2Y8sI6", + "name" : "He Used To Be A Lovely Boy", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/e9f363113af9ac9ed7951f0bdd512f967d52613c", + "track_number" : 9, + "type" : "track", + "uri" : "spotify:track:4rCgYClAhCLuf9xD2Y8sI6" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 236986, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2RsfSyrYHjUtGeCVBf6ib2" + }, + "href" : "https://api.spotify.com/v1/tracks/2RsfSyrYHjUtGeCVBf6ib2", + "id" : "2RsfSyrYHjUtGeCVBf6ib2", + "name" : "Thin Air", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/4395e17bea391d7b5824bb4d367b47beb3142bfe", + "track_number" : 10, + "type" : "track", + "uri" : "spotify:track:2RsfSyrYHjUtGeCVBf6ib2" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 269880, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2UwM9vm7I4wx3RxGx8DR17" + }, + "href" : "https://api.spotify.com/v1/tracks/2UwM9vm7I4wx3RxGx8DR17", + "id" : "2UwM9vm7I4wx3RxGx8DR17", + "name" : "The Iron Sea", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/48a5197382821d427a48f94cf45906c09aab2762", + "track_number" : 11, + "type" : "track", + "uri" : "spotify:track:2UwM9vm7I4wx3RxGx8DR17" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 235440, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2WMpag1ouW7zIySG8PcrIW" + }, + "href" : "https://api.spotify.com/v1/tracks/2WMpag1ouW7zIySG8PcrIW", + "id" : "2WMpag1ouW7zIySG8PcrIW", + "name" : "Maybe I Can Change", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/fea170b36edaa1b644545f54560c969d8baaeec7", + "track_number" : 12, + "type" : "track", + "uri" : "spotify:track:2WMpag1ouW7zIySG8PcrIW" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 229586, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/7ngI6zHe2AA4YncwFytNR1" + }, + "href" : "https://api.spotify.com/v1/tracks/7ngI6zHe2AA4YncwFytNR1", + "id" : "7ngI6zHe2AA4YncwFytNR1", + "name" : "Time To Go", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/ba2b5a865f75d843caa00bac10659711c1c78aa3", + "track_number" : 13, + "type" : "track", + "uri" : "spotify:track:7ngI6zHe2AA4YncwFytNR1" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 230880, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2BUKGneA8BFCelJhoCIZ7u" + }, + "href" : "https://api.spotify.com/v1/tracks/2BUKGneA8BFCelJhoCIZ7u", + "id" : "2BUKGneA8BFCelJhoCIZ7u", + "name" : "Staring At The Ceiling", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/5c7d676225e325a3e0ad8e824122ce76963b155b", + "track_number" : 14, + "type" : "track", + "uri" : "spotify:track:2BUKGneA8BFCelJhoCIZ7u" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 294693, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/7rY5n8rnQnNwAtnNfCUQ0O" + }, + "href" : "https://api.spotify.com/v1/tracks/7rY5n8rnQnNwAtnNfCUQ0O", + "id" : "7rY5n8rnQnNwAtnNfCUQ0O", + "name" : "Myth", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/4b96ff12a3f1703334596629a5461e5676a6e2c9", + "track_number" : 15, + "type" : "track", + "uri" : "spotify:track:7rY5n8rnQnNwAtnNfCUQ0O" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 224986, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/0SY7oTzyTMpiXgP4ufO7VW" + }, + "href" : "https://api.spotify.com/v1/tracks/0SY7oTzyTMpiXgP4ufO7VW", + "id" : "0SY7oTzyTMpiXgP4ufO7VW", + "name" : "Difficult Child", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/74f60e142fab9299e91b93d1ec3df03322ef4742", + "track_number" : 16, + "type" : "track", + "uri" : "spotify:track:0SY7oTzyTMpiXgP4ufO7VW" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 221200, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/7dDuGGxttttGh0h9CJ4cUu" + }, + "href" : "https://api.spotify.com/v1/tracks/7dDuGGxttttGh0h9CJ4cUu", + "id" : "7dDuGGxttttGh0h9CJ4cUu", + "name" : "Sea Fog - Live At Arena Ciudad De Mexico, Mexico City / 2012", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/c1d12193cf937a5e9905209aef410e3572754797", + "track_number" : 17, + "type" : "track", + "uri" : "spotify:track:7dDuGGxttttGh0h9CJ4cUu" + }, { + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/53A0W3U0s8diEn9RhXQhVz" + }, + "href" : "https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", + "id" : "53A0W3U0s8diEn9RhXQhVz", + "name" : "Keane", + "type" : "artist", + "uri" : "spotify:artist:53A0W3U0s8diEn9RhXQhVz" + } ], + "disc_number" : 2, + "duration_ms" : 394786, + "explicit" : false, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/0bxCO9Bbm1SkK9BU2DbsYg" + }, + "href" : "https://api.spotify.com/v1/tracks/0bxCO9Bbm1SkK9BU2DbsYg", + "id" : "0bxCO9Bbm1SkK9BU2DbsYg", + "name" : "Russian Farmer's Song", + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/c7829ff734f75342537dcb3f662fef055075749c", + "track_number" : 18, + "type" : "track", + "uri" : "spotify:track:0bxCO9Bbm1SkK9BU2DbsYg" + } ], + "limit" : 50, + "next" : null, + "offset" : 0, + "previous" : null, + "total" : 38 + }, + "type" : "album", + "uri" : "spotify:album:41MnTivkwTO3UUJ8DrqEJJ" + } ] } \ No newline at end of file diff --git a/src/test/fixtures/search-album.json b/src/test/fixtures/search-album.json index f52bf648d..4cfeac324 100644 --- a/src/test/fixtures/search-album.json +++ b/src/test/fixtures/search-album.json @@ -1,592 +1,34 @@ { - "href": "https://api.spotify.com/v1/albums/search?query=Sawdust&offset=0&limit=20", - "items": [ - { - "album_type": "album", - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LV", - "MC", - "MT", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW" - ], - "external_ids": { - "upc": "00602517549326" - }, - "external_urls": { - "spotify": "https://open.spotify.com/album/68NlXKRuJ1YqrhIbwe864y" - }, - "genres": [ - "Alternative Pop/Rock", - "Alternative/Indie Rock", - "New Wave/Post-Punk Revival", - "Pop/Rock" - ], - "href": "https://api.spotify.com/v1/albums/68NlXKRuJ1YqrhIbwe864y", - "id": "68NlXKRuJ1YqrhIbwe864y", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/7977a9a7851eab9db2eb22bdc064c93153077c42", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/f5ca8e7c7c335651aa1e04d99f218994a71b9bf2", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/22314e72bf196c285eff689140f36668cb1603c7", - "width": 64 - } - ], - "name": "Sawdust", - "popularity": 62, - "release_date": { - "day": null, - "month": null, - "year": 2007 - }, - "tracks": [ - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - }, - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/42TFhl7WlMRXiNqzSrnzPL" - }, - "href": "https://api.spotify.com/v1/artists/42TFhl7WlMRXiNqzSrnzPL", - "id": "42TFhl7WlMRXiNqzSrnzPL", - "name": "Lou Reed", - "type": "artist", - "uri": "spotify:artist:42TFhl7WlMRXiNqzSrnzPL" - } - ], - "disc_number": 1, - "duration_ms": 225160, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/42b041CrWScCEr4HVI5Zrs" - }, - "href": "https://api.spotify.com/v1/tracks/42b041CrWScCEr4HVI5Zrs", - "id": "42b041CrWScCEr4HVI5Zrs", - "name": "Tranquilize", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/64980f438cc5913a664c3ff9b9fa3cd48437b419", - "track_number": 1, - "type": "track", - "uri": "spotify:track:42b041CrWScCEr4HVI5Zrs" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 247240, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/3CzP7ddFifTekunK8tRQNT" - }, - "href": "https://api.spotify.com/v1/tracks/3CzP7ddFifTekunK8tRQNT", - "id": "3CzP7ddFifTekunK8tRQNT", - "name": "Shadowplay", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/a6b313451b866dea8ebc80fbe99d1fd89b05a000", - "track_number": 2, - "type": "track", - "uri": "spotify:track:3CzP7ddFifTekunK8tRQNT" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 285800, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/4vbTCcHG2M73uueGL0osWX" - }, - "href": "https://api.spotify.com/v1/tracks/4vbTCcHG2M73uueGL0osWX", - "id": "4vbTCcHG2M73uueGL0osWX", - "name": "All The Pretty Faces", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/e9cffabcec4aa5154e5ced29151eeff95feb664b", - "track_number": 3, - "type": "track", - "uri": "spotify:track:4vbTCcHG2M73uueGL0osWX" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 218493, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/06OJkTnpSEXqLrpXW00AAE" - }, - "href": "https://api.spotify.com/v1/tracks/06OJkTnpSEXqLrpXW00AAE", - "id": "06OJkTnpSEXqLrpXW00AAE", - "name": "Leave The Bourbon On The Shelf", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/2de3baea62b7d0b1dcf6c0d6d2517bcd352e3a6c", - "track_number": 4, - "type": "track", - "uri": "spotify:track:06OJkTnpSEXqLrpXW00AAE" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 258866, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/5eK2mh8kBu9fznHwyWksDr" - }, - "href": "https://api.spotify.com/v1/tracks/5eK2mh8kBu9fznHwyWksDr", - "id": "5eK2mh8kBu9fznHwyWksDr", - "name": "Sweet Talk", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/819d5a7ea996099bca10cb5b697fab8abbe5681e", - "track_number": 5, - "type": "track", - "uri": "spotify:track:5eK2mh8kBu9fznHwyWksDr" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 153560, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/6ACSyAw0Vvss68sLS7ZknC" - }, - "href": "https://api.spotify.com/v1/tracks/6ACSyAw0Vvss68sLS7ZknC", - "id": "6ACSyAw0Vvss68sLS7ZknC", - "name": "Under The Gun", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/68ec1ac0f276eeea6b63045adfbaed523c62dc10", - "track_number": 6, - "type": "track", - "uri": "spotify:track:6ACSyAw0Vvss68sLS7ZknC" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 206200, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/4PLvKR0GhgUykQtxBlkVTP" - }, - "href": "https://api.spotify.com/v1/tracks/4PLvKR0GhgUykQtxBlkVTP", - "id": "4PLvKR0GhgUykQtxBlkVTP", - "name": "Where The White Boys Dance", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/ed6ae814f5e332185ef53d970e0118b5c92948cd", - "track_number": 7, - "type": "track", - "uri": "spotify:track:4PLvKR0GhgUykQtxBlkVTP" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 166240, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/4dLbHDp9q8Pa0Q09DGC9Hn" - }, - "href": "https://api.spotify.com/v1/tracks/4dLbHDp9q8Pa0Q09DGC9Hn", - "id": "4dLbHDp9q8Pa0Q09DGC9Hn", - "name": "Show You How", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/5518abbdfbd4bf3c1a226c3951e0865cefc68f7b", - "track_number": 8, - "type": "track", - "uri": "spotify:track:4dLbHDp9q8Pa0Q09DGC9Hn" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 229973, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/61QCxMSANbjmWcMtd9Xt0B" - }, - "href": "https://api.spotify.com/v1/tracks/61QCxMSANbjmWcMtd9Xt0B", - "id": "61QCxMSANbjmWcMtd9Xt0B", - "name": "Move Away", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/5403203ba35103b0986e80b1abf4643371b1367a", - "track_number": 9, - "type": "track", - "uri": "spotify:track:61QCxMSANbjmWcMtd9Xt0B" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 256546, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/2D6oFWSq1ToR8BSTChJYFU" - }, - "href": "https://api.spotify.com/v1/tracks/2D6oFWSq1ToR8BSTChJYFU", - "id": "2D6oFWSq1ToR8BSTChJYFU", - "name": "Glamorous Indie Rock And Roll", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/fc7a50fc1b1fc172ec5548bf26727b105e3cb9e1", - "track_number": 10, - "type": "track", - "uri": "spotify:track:2D6oFWSq1ToR8BSTChJYFU" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 222906, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/0eMEip7MhfSqqk1A7GQq5B" - }, - "href": "https://api.spotify.com/v1/tracks/0eMEip7MhfSqqk1A7GQq5B", - "id": "0eMEip7MhfSqqk1A7GQq5B", - "name": "Who Let You Go?", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/be30219fdfe78a781ce01d4321f021fa695d2565", - "track_number": 11, - "type": "track", - "uri": "spotify:track:0eMEip7MhfSqqk1A7GQq5B" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 230346, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/4Kyvgw5Dv5tSBQ1DiAeh6e" - }, - "href": "https://api.spotify.com/v1/tracks/4Kyvgw5Dv5tSBQ1DiAeh6e", - "id": "4Kyvgw5Dv5tSBQ1DiAeh6e", - "name": "The Ballad of Michael Valentine", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/ae27c13ccccb8c3e5068d4ee7334333474abf79f", - "track_number": 12, - "type": "track", - "uri": "spotify:track:4Kyvgw5Dv5tSBQ1DiAeh6e" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 185186, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/2RVzV8KSDE4hKjr1miE1qo" - }, - "href": "https://api.spotify.com/v1/tracks/2RVzV8KSDE4hKjr1miE1qo", - "id": "2RVzV8KSDE4hKjr1miE1qo", - "name": "Ruby, Don't Take Your Love To Town", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/6d9b466424826ced3489ba683be3fd636b1c76f9", - "track_number": 13, - "type": "track", - "uri": "spotify:track:2RVzV8KSDE4hKjr1miE1qo" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 254786, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/5wZgSOiKk6iWaPNqtQCDlk" - }, - "href": "https://api.spotify.com/v1/tracks/5wZgSOiKk6iWaPNqtQCDlk", - "id": "5wZgSOiKk6iWaPNqtQCDlk", - "name": "Daddy's Eyes", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/559caf0a8f80e4f00994803ee17d5644e734f896", - "track_number": 14, - "type": "track", - "uri": "spotify:track:5wZgSOiKk6iWaPNqtQCDlk" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 223720, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/3pmVE2clXTAJY9acQhJwRW" - }, - "href": "https://api.spotify.com/v1/tracks/3pmVE2clXTAJY9acQhJwRW", - "id": "3pmVE2clXTAJY9acQhJwRW", - "name": "Sam's Town - Live from Abbey Road / 2006", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/592c386e93ec9cc10bb654fbaa241477106a3bb6", - "track_number": 15, - "type": "track", - "uri": "spotify:track:3pmVE2clXTAJY9acQhJwRW" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 327866, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/15okJ22zpwpw5MU2Nn3BSI" - }, - "href": "https://api.spotify.com/v1/tracks/15okJ22zpwpw5MU2Nn3BSI", - "id": "15okJ22zpwpw5MU2Nn3BSI", - "name": "Romeo And Juliet", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/744ac7f69f4d6e2d820c886f6abff4902dc6889d", - "track_number": 16, - "type": "track", - "uri": "spotify:track:15okJ22zpwpw5MU2Nn3BSI" - }, - { - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "disc_number": 1, - "duration_ms": 528026, - "explicit": false, - "external_urls": { - "spotify": "https://open.spotify.com/track/2gt7oM6spRcAIzlfyt5Z9H" - }, - "href": "https://api.spotify.com/v1/tracks/2gt7oM6spRcAIzlfyt5Z9H", - "id": "2gt7oM6spRcAIzlfyt5Z9H", - "name": "Mr. Brightside - Jacques Lu Cont's Thin White Duke Mix", - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/ac67dc847518713795b3cff856f31012c28fbce5", - "track_number": 17, - "type": "track", - "uri": "spotify:track:2gt7oM6spRcAIzlfyt5Z9H" - } - ], - "type": "album", - "uri": "spotify:album:68NlXKRuJ1YqrhIbwe864y" - } - ], - "limit": 20, - "next": "https://api.spotify.com/v1/albums/search?query=Sawdust&offset=20&limit=9", - "offset": 0, - "previous": null, - "total": 29 + "albums" : { + "href" : "https://api.spotify.com/v1/search?query=tania+bowra&offset=0&limit=20&type=album", + "items" : [ { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + } ], + "limit" : 20, + "next" : null, + "offset" : 0, + "previous" : null, + "total" : 1 + } } \ No newline at end of file diff --git a/src/test/fixtures/search-artist.json b/src/test/fixtures/search-artist.json index e7f32c4cf..b7811e03c 100644 --- a/src/test/fixtures/search-artist.json +++ b/src/test/fixtures/search-artist.json @@ -1,39 +1,35 @@ { - "href": "https://api.spotify.com/v1/artists/search?query=tania bowra&offset=0&limit=20", - "items": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + "artists" : { + "href" : "https://api.spotify.com/v1/search?query=tania+bowra&offset=0&limit=20&type=artist", + "items" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" }, - "genres": [], - "href": "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id": "08td7MxkoHQkXnWAYD8d6Q", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width": 64 - } - ], - "name": "Tania Bowra", - "popularity": 0, - "type": "artist", - "uri": "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } - ], - "limit": 20, - "next": null, - "offset": 0, - "previous": null, - "total": 1 + "genres" : [ ], + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Tania Bowra", + "popularity" : 0, + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "limit" : 20, + "next" : null, + "offset" : 0, + "previous" : null, + "total" : 1 + } } \ No newline at end of file diff --git a/src/test/fixtures/search-track-page1.json b/src/test/fixtures/search-track-page1.json index 63055c1e6..36c407ec4 100644 --- a/src/test/fixtures/search-track-page1.json +++ b/src/test/fixtures/search-track-page1.json @@ -1 +1,656 @@ -{"href":"https://api.spotify.com/v1/tracks/search?query=Brightside&offset=0&limit=20","items":[{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/6TJmQnO44YE5BtTxH8pop1"},"href":"https://api.spotify.com/v1/albums/6TJmQnO44YE5BtTxH8pop1","id":"6TJmQnO44YE5BtTxH8pop1","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/8e13218039f81b000553e25522a7f0d7a0600f2e","width":629},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/8c1e066b5d1045038437d92815d49987f519e44f","width":295},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/d49268a8fc0768084f4750cf1647709e89a27172","width":63}],"name":"Hot Fuss","type":"album","uri":"spotify:album:6TJmQnO44YE5BtTxH8pop1"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu"},"href":"https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu","id":"0C0XlULifJtAgn6ZNCW2eu","name":"The Killers","type":"artist","uri":"spotify:artist:0C0XlULifJtAgn6ZNCW2eu"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW","UY"],"disc_number":1,"duration_ms":222075,"explicit":false,"external_ids":{"isrc":"USIR20400274"},"external_urls":{"spotify":"https://open.spotify.com/track/0eGsygTp906u18L0Oimnem"},"href":"https://api.spotify.com/v1/tracks/0eGsygTp906u18L0Oimnem","id":"0eGsygTp906u18L0Oimnem","name":"Mr. Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/f454c8224828e21fa146af84916fd22cb89cedc6","track_number":2,"type":"track","uri":"spotify:track:0eGsygTp906u18L0Oimnem"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/1m3pbwuYJS9OsXyM2jOSXE"},"href":"https://api.spotify.com/v1/albums/1m3pbwuYJS9OsXyM2jOSXE","id":"1m3pbwuYJS9OsXyM2jOSXE","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/5a662b614397a7870a9289381219bca0210695a3","width":640},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/c3093c0c0cc69c8138e99e91cdec41f614d71eeb","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/cb409b9aa93c61327f59367be1fa961558f24f14","width":64}],"name":"Direct Hits","type":"album","uri":"spotify:album:1m3pbwuYJS9OsXyM2jOSXE"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu"},"href":"https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu","id":"0C0XlULifJtAgn6ZNCW2eu","name":"The Killers","type":"artist","uri":"spotify:artist:0C0XlULifJtAgn6ZNCW2eu"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW","UY"],"disc_number":1,"duration_ms":223973,"explicit":false,"external_ids":{"isrc":"USIR20400274"},"external_urls":{"spotify":"https://open.spotify.com/track/5zvJ6DUahHHjeknQPn7iAH"},"href":"https://api.spotify.com/v1/tracks/5zvJ6DUahHHjeknQPn7iAH","id":"5zvJ6DUahHHjeknQPn7iAH","name":"Mr. Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/0b32e8c0152a7ae231a3e3a3a8e51c31da577c5a","track_number":1,"type":"track","uri":"spotify:track:5zvJ6DUahHHjeknQPn7iAH"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/4A0K2Z4k7num90Qqi4ajk7"},"href":"https://api.spotify.com/v1/albums/4A0K2Z4k7num90Qqi4ajk7","id":"4A0K2Z4k7num90Qqi4ajk7","images":[{"height":571,"url":"https://d3rt1990lpmkn.cloudfront.net/original/c375006ec2cfff23bdc520f73f9ad71e37a9a8e9","width":640},{"height":268,"url":"https://d3rt1990lpmkn.cloudfront.net/original/e2229d955ccc46dc63948283a19ecd73b6d5e0e2","width":300},{"height":57,"url":"https://d3rt1990lpmkn.cloudfront.net/original/025a37140ca7df06199178ae5f8069ce8069a845","width":64}],"name":"The Summer EP","type":"album","uri":"spotify:album:4A0K2Z4k7num90Qqi4ajk7"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/5pUmXBIQtqpvdV1HAy2xYC"},"href":"https://api.spotify.com/v1/artists/5pUmXBIQtqpvdV1HAy2xYC","id":"5pUmXBIQtqpvdV1HAy2xYC","name":"Never Shout Never","type":"artist","uri":"spotify:artist:5pUmXBIQtqpvdV1HAy2xYC"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CA","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GB","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MX","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW","US","UY"],"disc_number":1,"duration_ms":125760,"explicit":false,"external_ids":{"isrc":"USSCU0900008"},"external_urls":{"spotify":"https://open.spotify.com/track/4ydfntQQR5g5gkACYwXHHt"},"href":"https://api.spotify.com/v1/tracks/4ydfntQQR5g5gkACYwXHHt","id":"4ydfntQQR5g5gkACYwXHHt","name":"On The Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/ba199abd994a93e2a8df50122ffec7ebe2071a25","track_number":5,"type":"track","uri":"spotify:track:4ydfntQQR5g5gkACYwXHHt"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/4jq3QW252vBI68ThF0pGsG"},"href":"https://api.spotify.com/v1/albums/4jq3QW252vBI68ThF0pGsG","id":"4jq3QW252vBI68ThF0pGsG","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/756e06757b341524a6ab731ffb82239dbea726e1","width":640},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/b9f5f96f4cb8483d681ab9eb58414e7d16efd872","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/75aff74170b0c03372fbebd6ee4387a58b2cb765","width":64}],"name":"Acoustic Sessions: Vol. 3","type":"album","uri":"spotify:album:4jq3QW252vBI68ThF0pGsG"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/7CQwac16i1W5ej8YpuL3dv"},"href":"https://api.spotify.com/v1/artists/7CQwac16i1W5ej8YpuL3dv","id":"7CQwac16i1W5ej8YpuL3dv","name":"Boyce Avenue","type":"artist","uri":"spotify:artist:7CQwac16i1W5ej8YpuL3dv"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CA","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GB","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MX","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW","US","UY"],"disc_number":1,"duration_ms":214634,"explicit":false,"external_ids":{"isrc":"US-TCC-10-48908"},"external_urls":{"spotify":"https://open.spotify.com/track/4GDNloQXjSfiKu17AiUVy9"},"href":"https://api.spotify.com/v1/tracks/4GDNloQXjSfiKu17AiUVy9","id":"4GDNloQXjSfiKu17AiUVy9","name":"Mr. Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/6472b0286cca1b73f7b625e3472c332f2af0bfd2","track_number":9,"type":"track","uri":"spotify:track:4GDNloQXjSfiKu17AiUVy9"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/1m3pbwuYJS9OsXyM2jOSXE"},"href":"https://api.spotify.com/v1/albums/1m3pbwuYJS9OsXyM2jOSXE","id":"1m3pbwuYJS9OsXyM2jOSXE","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/5a662b614397a7870a9289381219bca0210695a3","width":640},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/c3093c0c0cc69c8138e99e91cdec41f614d71eeb","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/cb409b9aa93c61327f59367be1fa961558f24f14","width":64}],"name":"Direct Hits","type":"album","uri":"spotify:album:1m3pbwuYJS9OsXyM2jOSXE"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu"},"href":"https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu","id":"0C0XlULifJtAgn6ZNCW2eu","name":"The Killers","type":"artist","uri":"spotify:artist:0C0XlULifJtAgn6ZNCW2eu"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW","UY"],"disc_number":1,"duration_ms":262560,"explicit":false,"external_ids":{"isrc":"USUM71312340"},"external_urls":{"spotify":"https://open.spotify.com/track/2zBr1gn08cg0XyEXFWlysq"},"href":"https://api.spotify.com/v1/tracks/2zBr1gn08cg0XyEXFWlysq","id":"2zBr1gn08cg0XyEXFWlysq","name":"Mr. Brightside - Original Demo","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/f4603bef74b748cbf18c4ac8504876e988f4e441","track_number":16,"type":"track","uri":"spotify:track:2zBr1gn08cg0XyEXFWlysq"},{"album":{"album_type":"single","external_urls":{"spotify":"https://open.spotify.com/album/1x8d5zJ99au9eyfDWqf6ne"},"href":"https://api.spotify.com/v1/albums/1x8d5zJ99au9eyfDWqf6ne","id":"1x8d5zJ99au9eyfDWqf6ne","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/56706ccb2a6a7c9a2dc7846885d0d529f8e61f7a","width":638},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/34ec9340020fff67a975a621a6ab99de3e735074","width":299},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/1660604501f235781933ba75f8cb7e5b2dabf435","width":64}],"name":"Mr. Brightside","type":"album","uri":"spotify:album:1x8d5zJ99au9eyfDWqf6ne"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu"},"href":"https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu","id":"0C0XlULifJtAgn6ZNCW2eu","name":"The Killers","type":"artist","uri":"spotify:artist:0C0XlULifJtAgn6ZNCW2eu"}],"available_markets":["AT","BE","CH","CR","CZ","DE","EE","FR","HU","IS","IT","LT","LV","PL","PT","RO","SE","SK","TR"],"disc_number":1,"duration_ms":527346,"explicit":false,"external_ids":{"isrc":"USIR20500022"},"external_urls":{"spotify":"https://open.spotify.com/track/6JhKde0BZHaWRF6qjMlzzD"},"href":"https://api.spotify.com/v1/tracks/6JhKde0BZHaWRF6qjMlzzD","id":"6JhKde0BZHaWRF6qjMlzzD","name":"Mr. Brightside - Jacques Lu Cont's Thin White Duke Mix","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/1b1c2baa9d99916cab723aba52271059ce168033","track_number":3,"type":"track","uri":"spotify:track:6JhKde0BZHaWRF6qjMlzzD"},{"album":{"album_type":"single","external_urls":{"spotify":"https://open.spotify.com/album/35gwWse8PdhWKfmymkBOLy"},"href":"https://api.spotify.com/v1/albums/35gwWse8PdhWKfmymkBOLy","id":"35gwWse8PdhWKfmymkBOLy","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/56706ccb2a6a7c9a2dc7846885d0d529f8e61f7a","width":638},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/34ec9340020fff67a975a621a6ab99de3e735074","width":299},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/1660604501f235781933ba75f8cb7e5b2dabf435","width":64}],"name":"Mr. Brightside","type":"album","uri":"spotify:album:35gwWse8PdhWKfmymkBOLy"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu"},"href":"https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu","id":"0C0XlULifJtAgn6ZNCW2eu","name":"The Killers","type":"artist","uri":"spotify:artist:0C0XlULifJtAgn6ZNCW2eu"}],"available_markets":["AR","AT","BG","BO","BR","CL","CO","CR","CY","CZ","DK","DO","EC","EE","ES","FI","GR","GT","HK","HN","HU","IE","IS","IT","LT","LV","MT","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PY","RO","SE","SG","SI","SK","SV","TR","TW"],"disc_number":1,"duration_ms":223250,"explicit":false,"external_ids":{"isrc":"USIR20400274"},"external_urls":{"spotify":"https://open.spotify.com/track/1odnNxp9EhAtZkeGifnve2"},"href":"https://api.spotify.com/v1/tracks/1odnNxp9EhAtZkeGifnve2","id":"1odnNxp9EhAtZkeGifnve2","name":"Mr. Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/d42cee33e46952c46904861fe676f4a1b285a872","track_number":1,"type":"track","uri":"spotify:track:1odnNxp9EhAtZkeGifnve2"},{"album":{"album_type":"single","external_urls":{"spotify":"https://open.spotify.com/album/0UCXHS0TUIXCwf4c8Byz4A"},"href":"https://api.spotify.com/v1/albums/0UCXHS0TUIXCwf4c8Byz4A","id":"0UCXHS0TUIXCwf4c8Byz4A","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/56706ccb2a6a7c9a2dc7846885d0d529f8e61f7a","width":638},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/34ec9340020fff67a975a621a6ab99de3e735074","width":299},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/1660604501f235781933ba75f8cb7e5b2dabf435","width":64}],"name":"Mr. Brightside","type":"album","uri":"spotify:album:0UCXHS0TUIXCwf4c8Byz4A"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu"},"href":"https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu","id":"0C0XlULifJtAgn6ZNCW2eu","name":"The Killers","type":"artist","uri":"spotify:artist:0C0XlULifJtAgn6ZNCW2eu"}],"available_markets":["AT","BE","CH","CZ","FR","IS","MY","NL","PL","PT","RO","SE","SK","TR"],"disc_number":1,"duration_ms":225093,"explicit":false,"external_ids":{"isrc":"USIR20400750"},"external_urls":{"spotify":"https://open.spotify.com/track/6A1uEZn5eEuGgVmxMpem7X"},"href":"https://api.spotify.com/v1/tracks/6A1uEZn5eEuGgVmxMpem7X","id":"6A1uEZn5eEuGgVmxMpem7X","name":"Mr. Brightside - CD Pro Version","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/a9461ce918d0e77a8bfd829da193c47d732e7118","track_number":1,"type":"track","uri":"spotify:track:6A1uEZn5eEuGgVmxMpem7X"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/10JoWJzLYBEYv8RSR5L0ow"},"href":"https://api.spotify.com/v1/albums/10JoWJzLYBEYv8RSR5L0ow","id":"10JoWJzLYBEYv8RSR5L0ow","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/4869ed178df59df759eaaeb835800caa458d7fc4","width":640},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/2213461a89b88c6c2c41b12c1ab4cd3903d11adb","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/85c51847d7e4bcf22039300eed4126fe14f0f818","width":64}],"name":"Acoustic Sessions, Vol. 4","type":"album","uri":"spotify:album:10JoWJzLYBEYv8RSR5L0ow"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/7CQwac16i1W5ej8YpuL3dv"},"href":"https://api.spotify.com/v1/artists/7CQwac16i1W5ej8YpuL3dv","id":"7CQwac16i1W5ej8YpuL3dv","name":"Boyce Avenue","type":"artist","uri":"spotify:artist:7CQwac16i1W5ej8YpuL3dv"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CA","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GB","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MX","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW","US","UY"],"disc_number":1,"duration_ms":214634,"explicit":false,"external_ids":{"isrc":"US-TCF-10-18555"},"external_urls":{"spotify":"https://open.spotify.com/track/7it1rqEDgo7sKK5BZqe0qj"},"href":"https://api.spotify.com/v1/tracks/7it1rqEDgo7sKK5BZqe0qj","id":"7it1rqEDgo7sKK5BZqe0qj","name":"Mr. Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/6472b0286cca1b73f7b625e3472c332f2af0bfd2","track_number":5,"type":"track","uri":"spotify:track:7it1rqEDgo7sKK5BZqe0qj"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/4wIUJ6kVdgsKdppNMYXKsF"},"href":"https://api.spotify.com/v1/albums/4wIUJ6kVdgsKdppNMYXKsF","id":"4wIUJ6kVdgsKdppNMYXKsF","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/b896642dcb13763736bbe3caf64a3873645093bf","width":640},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/7077fc6e1871204e4c8a717e2fb37cd3c2b80780","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/18a37ccc0a4e2cc90fe7b1f0de5f5814a5ed9a3e","width":64}],"name":"Memory Lane (The Best Of McFly) [Deluxe Edition]","type":"album","uri":"spotify:album:4wIUJ6kVdgsKdppNMYXKsF"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/47izDDvtOxxz3FzHYuUptd"},"href":"https://api.spotify.com/v1/artists/47izDDvtOxxz3FzHYuUptd","id":"47izDDvtOxxz3FzHYuUptd","name":"McFly","type":"artist","uri":"spotify:artist:47izDDvtOxxz3FzHYuUptd"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GB","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW","UY"],"disc_number":2,"duration_ms":217190,"explicit":false,"external_ids":{"isrc":"GBAAN0500468"},"external_urls":{"spotify":"https://open.spotify.com/track/0YtcYTH9TkLbaUjSJUgbJ6"},"href":"https://api.spotify.com/v1/tracks/0YtcYTH9TkLbaUjSJUgbJ6","id":"0YtcYTH9TkLbaUjSJUgbJ6","name":"Mr. Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/97b578ff5f09adabf2e6e2c123de749c9ba5bdd4","track_number":17,"type":"track","uri":"spotify:track:0YtcYTH9TkLbaUjSJUgbJ6"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/4OHNH3sDzIxnmUADXzv2kT"},"href":"https://api.spotify.com/v1/albums/4OHNH3sDzIxnmUADXzv2kT","id":"4OHNH3sDzIxnmUADXzv2kT","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/8e13218039f81b000553e25522a7f0d7a0600f2e","width":629},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/8c1e066b5d1045038437d92815d49987f519e44f","width":295},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/d49268a8fc0768084f4750cf1647709e89a27172","width":63}],"name":"Hot Fuss (Deluxe Version)","type":"album","uri":"spotify:album:4OHNH3sDzIxnmUADXzv2kT"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu"},"href":"https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu","id":"0C0XlULifJtAgn6ZNCW2eu","name":"The Killers","type":"artist","uri":"spotify:artist:0C0XlULifJtAgn6ZNCW2eu"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GB","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW","UY"],"disc_number":1,"duration_ms":222200,"explicit":false,"external_ids":{"isrc":"GBFFP0300052"},"external_urls":{"spotify":"https://open.spotify.com/track/3n3Ppam7vgaVa1iaRUc9Lp"},"href":"https://api.spotify.com/v1/tracks/3n3Ppam7vgaVa1iaRUc9Lp","id":"3n3Ppam7vgaVa1iaRUc9Lp","name":"Mr. Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/95a5ea928c5493ca64a05d0daa0c0fa121694818","track_number":2,"type":"track","uri":"spotify:track:3n3Ppam7vgaVa1iaRUc9Lp"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/5QtJ3fjPxB8yFMVAjJ3mA5"},"href":"https://api.spotify.com/v1/albums/5QtJ3fjPxB8yFMVAjJ3mA5","id":"5QtJ3fjPxB8yFMVAjJ3mA5","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/081565b1b42a1ffcc13349c208414ffc8b404581","width":640},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/22852d95057bc85ed9f769b49151c05ed9dfa359","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/d67367fc416f04b2f616b2da6a25e8843d9b024a","width":64}],"name":"Nu Rock","type":"album","uri":"spotify:album:5QtJ3fjPxB8yFMVAjJ3mA5"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu"},"href":"https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu","id":"0C0XlULifJtAgn6ZNCW2eu","name":"The Killers","type":"artist","uri":"spotify:artist:0C0XlULifJtAgn6ZNCW2eu"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GB","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MY","NI","NL","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW"],"disc_number":1,"duration_ms":223186,"explicit":false,"external_ids":{"isrc":"USIR20400274"},"external_urls":{"spotify":"https://open.spotify.com/track/2UU6Pq9LaX1xWdrqUVoCW1"},"href":"https://api.spotify.com/v1/tracks/2UU6Pq9LaX1xWdrqUVoCW1","id":"2UU6Pq9LaX1xWdrqUVoCW1","name":"Mr. Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/167745b42018b58d42810ebf32f50b3e8c715018","track_number":1,"type":"track","uri":"spotify:track:2UU6Pq9LaX1xWdrqUVoCW1"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/1zIUKU5nWTtfmlITcrFgyR"},"href":"https://api.spotify.com/v1/albums/1zIUKU5nWTtfmlITcrFgyR","id":"1zIUKU5nWTtfmlITcrFgyR","images":[{"height":600,"url":"https://d3rt1990lpmkn.cloudfront.net/original/32211cefe17ed2db1eb416bec29929dfeaa29a53","width":600},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/b4ddceb4e5d11e786146356e89426e8d82ee5c61","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/63d16c56716fe894bc76fd64bb98a15e6a537121","width":64}],"name":"Brightside","type":"album","uri":"spotify:album:1zIUKU5nWTtfmlITcrFgyR"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/2x7EATekOPhFGRx3syMGEC"},"href":"https://api.spotify.com/v1/artists/2x7EATekOPhFGRx3syMGEC","id":"2x7EATekOPhFGRx3syMGEC","name":"The Knocks","type":"artist","uri":"spotify:artist:2x7EATekOPhFGRx3syMGEC"}],"available_markets":["AR","AT","AU","BE","BG","BO","BR","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","GB","GR","GT","HK","HN","HU","IE","IS","IT","LT","LU","LV","MT","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW"],"disc_number":1,"duration_ms":269173,"explicit":false,"external_ids":{"isrc":"USUM71115939"},"external_urls":{"spotify":"https://open.spotify.com/track/6805cAUNOsNgnOna7yu3sK"},"href":"https://api.spotify.com/v1/tracks/6805cAUNOsNgnOna7yu3sK","id":"6805cAUNOsNgnOna7yu3sK","name":"Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/f0560cbfd95716cd67e58febb9348b43aa74d35b","track_number":1,"type":"track","uri":"spotify:track:6805cAUNOsNgnOna7yu3sK"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/5SYfYt6WXugR5ssTFWYAzZ"},"href":"https://api.spotify.com/v1/albums/5SYfYt6WXugR5ssTFWYAzZ","id":"5SYfYt6WXugR5ssTFWYAzZ","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/d1875295e4770cf69181e4549abb45cfabfc80af","width":640},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/c7c28cb153edcdd9e1dfab9fdd56412bf4ca77bd","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/bf53f7ae35a20f27c23081e59999656c8b712e0d","width":64}],"name":"A Curious Thing (Exclusive Deluxe BP2)","type":"album","uri":"spotify:album:5SYfYt6WXugR5ssTFWYAzZ"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/1hJuGCUpefX24GFmss9bjH"},"href":"https://api.spotify.com/v1/artists/1hJuGCUpefX24GFmss9bjH","id":"1hJuGCUpefX24GFmss9bjH","name":"Amy Macdonald","type":"artist","uri":"spotify:artist:1hJuGCUpefX24GFmss9bjH"}],"available_markets":["AD","AR","BE","BO","BR","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","GR","GT","HK","HN","HU","IE","IS","LI","LT","LU","LV","MC","MT","MY","NI","NL","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW"],"disc_number":2,"duration_ms":252120,"explicit":false,"external_ids":{"isrc":"GBUM71000896"},"external_urls":{"spotify":"https://open.spotify.com/track/49Vi3pAcWoq8bNectW8D9R"},"href":"https://api.spotify.com/v1/tracks/49Vi3pAcWoq8bNectW8D9R","id":"49Vi3pAcWoq8bNectW8D9R","name":"Mr Brightside - Live At Barrowland Ballroom","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/53045b2743a0a2f96655377e5b0a018af75a0dca","track_number":6,"type":"track","uri":"spotify:track:49Vi3pAcWoq8bNectW8D9R"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/0Xa9TgVaUqQosIK3YcIWqL"},"href":"https://api.spotify.com/v1/albums/0Xa9TgVaUqQosIK3YcIWqL","id":"0Xa9TgVaUqQosIK3YcIWqL","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/0b841b18b4e87f31c519b6e3fff309ac4ede0d78","width":640},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/183e4443912c7ad162fb14cbba62634460904679","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/cd8cfec88abaddc6abbef56f0b270f03d7e5209a","width":64}],"name":"Covers Album Vol. 03 (Three)","type":"album","uri":"spotify:album:0Xa9TgVaUqQosIK3YcIWqL"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/3CckGnXzzJ9GARII95dDek"},"href":"https://api.spotify.com/v1/artists/3CckGnXzzJ9GARII95dDek","id":"3CckGnXzzJ9GARII95dDek","name":"ortoPilot","type":"artist","uri":"spotify:artist:3CckGnXzzJ9GARII95dDek"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CA","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GB","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MX","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW","US","UY"],"disc_number":1,"duration_ms":246642,"explicit":false,"external_ids":{"isrc":"GBDMT0800871"},"external_urls":{"spotify":"https://open.spotify.com/track/7gIe8QpcfMKJJ5MSsCa472"},"href":"https://api.spotify.com/v1/tracks/7gIe8QpcfMKJJ5MSsCa472","id":"7gIe8QpcfMKJJ5MSsCa472","name":"Mr Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/8cfba6457e5b1ac2ff0b77933878b2a3452f8568","track_number":6,"type":"track","uri":"spotify:track:7gIe8QpcfMKJJ5MSsCa472"},{"album":{"album_type":"single","external_urls":{"spotify":"https://open.spotify.com/album/1x8d5zJ99au9eyfDWqf6ne"},"href":"https://api.spotify.com/v1/albums/1x8d5zJ99au9eyfDWqf6ne","id":"1x8d5zJ99au9eyfDWqf6ne","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/56706ccb2a6a7c9a2dc7846885d0d529f8e61f7a","width":638},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/34ec9340020fff67a975a621a6ab99de3e735074","width":299},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/1660604501f235781933ba75f8cb7e5b2dabf435","width":64}],"name":"Mr. Brightside","type":"album","uri":"spotify:album:1x8d5zJ99au9eyfDWqf6ne"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu"},"href":"https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu","id":"0C0XlULifJtAgn6ZNCW2eu","name":"The Killers","type":"artist","uri":"spotify:artist:0C0XlULifJtAgn6ZNCW2eu"}],"available_markets":["AT","BE","CH","CR","CZ","DE","EE","FR","HU","IS","IT","LT","LV","PL","PT","RO","SE","SK","TR"],"disc_number":1,"duration_ms":225093,"explicit":false,"external_ids":{"isrc":"USIR20400750"},"external_urls":{"spotify":"https://open.spotify.com/track/6bLDDvzZUi4v4ORd35Gcgs"},"href":"https://api.spotify.com/v1/tracks/6bLDDvzZUi4v4ORd35Gcgs","id":"6bLDDvzZUi4v4ORd35Gcgs","name":"Mr. Brightside - CD Pro Version","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/51b9c041f54ad4c3a14723dc4bc28711912b32b5","track_number":1,"type":"track","uri":"spotify:track:6bLDDvzZUi4v4ORd35Gcgs"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/1iVt0tBTAtI36FhmsxhuVd"},"href":"https://api.spotify.com/v1/albums/1iVt0tBTAtI36FhmsxhuVd","id":"1iVt0tBTAtI36FhmsxhuVd","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/9a73a651f576e518b71bf2cb0bb0fb52ac64cf8f","width":640},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/a717f39245d19327daa1cc07d6cad8830291303c","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/795c6c4751623d33a0ef1da399f8a6d1d0c98128","width":64}],"name":"Covers Album Vol. 01 (One)","type":"album","uri":"spotify:album:1iVt0tBTAtI36FhmsxhuVd"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/3CckGnXzzJ9GARII95dDek"},"href":"https://api.spotify.com/v1/artists/3CckGnXzzJ9GARII95dDek","id":"3CckGnXzzJ9GARII95dDek","name":"ortoPilot","type":"artist","uri":"spotify:artist:3CckGnXzzJ9GARII95dDek"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CA","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GB","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MX","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW","US","UY"],"disc_number":1,"duration_ms":250619,"explicit":false,"external_ids":{"isrc":"GBDMT0800841"},"external_urls":{"spotify":"https://open.spotify.com/track/6iXt0dkyImkUVq8MB275p6"},"href":"https://api.spotify.com/v1/tracks/6iXt0dkyImkUVq8MB275p6","id":"6iXt0dkyImkUVq8MB275p6","name":"Mr Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/67180ad97215663d7f2e4d1b0195af03e11a990d","track_number":5,"type":"track","uri":"spotify:track:6iXt0dkyImkUVq8MB275p6"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/68NlXKRuJ1YqrhIbwe864y"},"href":"https://api.spotify.com/v1/albums/68NlXKRuJ1YqrhIbwe864y","id":"68NlXKRuJ1YqrhIbwe864y","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/7977a9a7851eab9db2eb22bdc064c93153077c42","width":640},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/f5ca8e7c7c335651aa1e04d99f218994a71b9bf2","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/22314e72bf196c285eff689140f36668cb1603c7","width":64}],"name":"Sawdust","type":"album","uri":"spotify:album:68NlXKRuJ1YqrhIbwe864y"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu"},"href":"https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu","id":"0C0XlULifJtAgn6ZNCW2eu","name":"The Killers","type":"artist","uri":"spotify:artist:0C0XlULifJtAgn6ZNCW2eu"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CH","CL","CO","CR","CY","CZ","DK","DO","EC","EE","ES","FI","FR","GB","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LV","MC","MT","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW"],"disc_number":1,"duration_ms":528026,"explicit":false,"external_ids":{"isrc":"USIR20500022"},"external_urls":{"spotify":"https://open.spotify.com/track/2gt7oM6spRcAIzlfyt5Z9H"},"href":"https://api.spotify.com/v1/tracks/2gt7oM6spRcAIzlfyt5Z9H","id":"2gt7oM6spRcAIzlfyt5Z9H","name":"Mr. Brightside - Jacques Lu Cont's Thin White Duke Mix","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/ac67dc847518713795b3cff856f31012c28fbce5","track_number":17,"type":"track","uri":"spotify:track:2gt7oM6spRcAIzlfyt5Z9H"},{"album":{"album_type":"single","external_urls":{"spotify":"https://open.spotify.com/album/35gwWse8PdhWKfmymkBOLy"},"href":"https://api.spotify.com/v1/albums/35gwWse8PdhWKfmymkBOLy","id":"35gwWse8PdhWKfmymkBOLy","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/56706ccb2a6a7c9a2dc7846885d0d529f8e61f7a","width":638},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/34ec9340020fff67a975a621a6ab99de3e735074","width":299},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/1660604501f235781933ba75f8cb7e5b2dabf435","width":64}],"name":"Mr. Brightside","type":"album","uri":"spotify:album:35gwWse8PdhWKfmymkBOLy"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu"},"href":"https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu","id":"0C0XlULifJtAgn6ZNCW2eu","name":"The Killers","type":"artist","uri":"spotify:artist:0C0XlULifJtAgn6ZNCW2eu"}],"available_markets":["AR","AT","BG","BO","BR","CL","CO","CR","CY","CZ","DK","DO","EC","EE","ES","FI","GR","GT","HK","HN","HU","IE","IS","IT","LT","LV","MT","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PY","RO","SE","SG","SI","SK","SV","TR","TW"],"disc_number":1,"duration_ms":278480,"explicit":false,"external_ids":{"isrc":"USIR20500155"},"external_urls":{"spotify":"https://open.spotify.com/track/2asVOzUheYGJIG3jUj15Ni"},"href":"https://api.spotify.com/v1/tracks/2asVOzUheYGJIG3jUj15Ni","id":"2asVOzUheYGJIG3jUj15Ni","name":"Mr. Brightside - RADIO - Jacques Lu Cont's Thin White Duke Mix","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/d05dbe937b0861cc4d7566cfefea07a1bd91fa42","track_number":2,"type":"track","uri":"spotify:track:2asVOzUheYGJIG3jUj15Ni"},{"album":{"album_type":"album","external_urls":{"spotify":"https://open.spotify.com/album/3Q6LxIPaD8Mn1L1bYjsSdA"},"href":"https://api.spotify.com/v1/albums/3Q6LxIPaD8Mn1L1bYjsSdA","id":"3Q6LxIPaD8Mn1L1bYjsSdA","images":[{"height":640,"url":"https://d3rt1990lpmkn.cloudfront.net/original/98dc4680e30d9367d0ec606a863b517210c84134","width":640},{"height":300,"url":"https://d3rt1990lpmkn.cloudfront.net/original/19b27f4ff8605018ba9612aef340db6eba613881","width":300},{"height":64,"url":"https://d3rt1990lpmkn.cloudfront.net/original/8e677546b285cc53267bc9dd5a94b1bda559ba76","width":64}],"name":"Welcome To Our Galaxee","type":"album","uri":"spotify:album:3Q6LxIPaD8Mn1L1bYjsSdA"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/4jpcMi4AYMiwLEBCDYTwkL"},"href":"https://api.spotify.com/v1/artists/4jpcMi4AYMiwLEBCDYTwkL","id":"4jpcMi4AYMiwLEBCDYTwkL","name":"Galaxee","type":"artist","uri":"spotify:artist:4jpcMi4AYMiwLEBCDYTwkL"}],"available_markets":["AD","AR","AT","AU","BE","BG","BO","BR","CA","CH","CL","CO","CR","CY","CZ","DE","DK","DO","EC","EE","ES","FI","FR","GB","GR","GT","HK","HN","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MX","MY","NI","NL","NO","NZ","PA","PE","PH","PL","PT","PY","RO","SE","SG","SI","SK","SV","TR","TW","US","UY"],"disc_number":1,"duration_ms":227920,"explicit":false,"external_ids":{"isrc":"NONOR0201140"},"external_urls":{"spotify":"https://open.spotify.com/track/19dotHoTeyQqRF9i3GcsxU"},"href":"https://api.spotify.com/v1/tracks/19dotHoTeyQqRF9i3GcsxU","id":"19dotHoTeyQqRF9i3GcsxU","name":"Brightside","popularity":0,"preview_url":"http://d318706lgtcm8e.cloudfront.net/mp3-preview/e6ef9c72a05aa0994dad0e3d014e9347670b1f73","track_number":14,"type":"track","uri":"spotify:track:19dotHoTeyQqRF9i3GcsxU"}],"limit":20,"next":"https://api.spotify.com/v1/tracks/search?query=Brightside&offset=20&limit=20","offset":0,"previous":null,"total":714} \ No newline at end of file +{ + "tracks" : { + "href" : "https://api.spotify.com/v1/search?query=tania+bowra&offset=0&limit=20&type=track", + "items" : [ { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 276773, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410001" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2TpxZ7JUBn3uw46aR7qd6V" + }, + "href" : "https://api.spotify.com/v1/tracks/2TpxZ7JUBn3uw46aR7qd6V", + "id" : "2TpxZ7JUBn3uw46aR7qd6V", + "name" : "All I Want", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/6d00206e32194d15df329d4770e4fa1f2ced3f57", + "track_number" : 1, + "type" : "track", + "uri" : "spotify:track:2TpxZ7JUBn3uw46aR7qd6V" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 247680, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410002" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/4PjcfyZZVE10TFd9EKA72r" + }, + "href" : "https://api.spotify.com/v1/tracks/4PjcfyZZVE10TFd9EKA72r", + "id" : "4PjcfyZZVE10TFd9EKA72r", + "name" : "Someday", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/2b15de922bf4f4b8cfe09c8448079b8ff7a45a5f", + "track_number" : 2, + "type" : "track", + "uri" : "spotify:track:4PjcfyZZVE10TFd9EKA72r" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 204093, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410003" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2tniUNfN0hmqavFuJ2NodO" + }, + "href" : "https://api.spotify.com/v1/tracks/2tniUNfN0hmqavFuJ2NodO", + "id" : "2tniUNfN0hmqavFuJ2NodO", + "name" : "Wet Wood", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/330aa73c34f81c164f00f7cf4e3de1368e59ff20", + "track_number" : 3, + "type" : "track", + "uri" : "spotify:track:2tniUNfN0hmqavFuJ2NodO" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 240253, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410004" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/1irrhbi54Uwsrky0s3SrPz" + }, + "href" : "https://api.spotify.com/v1/tracks/1irrhbi54Uwsrky0s3SrPz", + "id" : "1irrhbi54Uwsrky0s3SrPz", + "name" : "Give It 2 Me", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/2f0bd7efcd2addda3330990366b81df3fdc37c8c", + "track_number" : 4, + "type" : "track", + "uri" : "spotify:track:1irrhbi54Uwsrky0s3SrPz" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 220173, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410005" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/4JAJ6ujlF593H31kA4UhjR" + }, + "href" : "https://api.spotify.com/v1/tracks/4JAJ6ujlF593H31kA4UhjR", + "id" : "4JAJ6ujlF593H31kA4UhjR", + "name" : "Be Mine", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/271590224d1b24af07b777ffc744191cda49c9b4", + "track_number" : 5, + "type" : "track", + "uri" : "spotify:track:4JAJ6ujlF593H31kA4UhjR" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 281946, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410006" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/6UbiYwgZJrwqB5ILDVk1e5" + }, + "href" : "https://api.spotify.com/v1/tracks/6UbiYwgZJrwqB5ILDVk1e5", + "id" : "6UbiYwgZJrwqB5ILDVk1e5", + "name" : "Desire", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/22ae385689d8ac4f3919ad26057edf215a70e912", + "track_number" : 6, + "type" : "track", + "uri" : "spotify:track:6UbiYwgZJrwqB5ILDVk1e5" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 189240, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410007" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/0WIfmQdGqTbZQjjoSxM8hB" + }, + "href" : "https://api.spotify.com/v1/tracks/0WIfmQdGqTbZQjjoSxM8hB", + "id" : "0WIfmQdGqTbZQjjoSxM8hB", + "name" : "Eastside", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/46b2b6e73675680a136a640fad9b96adb4db37ae", + "track_number" : 7, + "type" : "track", + "uri" : "spotify:track:0WIfmQdGqTbZQjjoSxM8hB" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 230440, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410008" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/1Xan3mf1E173v2n4wbQFeO" + }, + "href" : "https://api.spotify.com/v1/tracks/1Xan3mf1E173v2n4wbQFeO", + "id" : "1Xan3mf1E173v2n4wbQFeO", + "name" : "Easy Way", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/1926686f64b709f529d94b8af39398a7d5551fc8", + "track_number" : 8, + "type" : "track", + "uri" : "spotify:track:1Xan3mf1E173v2n4wbQFeO" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 281320, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410009" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5cBLGuA6AFlZISzkRiE7IT" + }, + "href" : "https://api.spotify.com/v1/tracks/5cBLGuA6AFlZISzkRiE7IT", + "id" : "5cBLGuA6AFlZISzkRiE7IT", + "name" : "Sympathy", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/b55ab54cf457eb8a178fefbbbf32c52f64be9d5d", + "track_number" : 9, + "type" : "track", + "uri" : "spotify:track:5cBLGuA6AFlZISzkRiE7IT" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 262400, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410010" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/3Wlw9nfntmKxVxLMzZeYLB" + }, + "href" : "https://api.spotify.com/v1/tracks/3Wlw9nfntmKxVxLMzZeYLB", + "id" : "3Wlw9nfntmKxVxLMzZeYLB", + "name" : "Pleasure And Pain", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/df9af685d4481ca17218b351263562f4b774adea", + "track_number" : 10, + "type" : "track", + "uri" : "spotify:track:3Wlw9nfntmKxVxLMzZeYLB" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 240973, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410011" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/6DonRyqagGQGdbjMKRy5f7" + }, + "href" : "https://api.spotify.com/v1/tracks/6DonRyqagGQGdbjMKRy5f7", + "id" : "6DonRyqagGQGdbjMKRy5f7", + "name" : "Peace Like A Summer Breeze", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/77823e8af90501f950c324eb96ac600af8004a36", + "track_number" : 11, + "type" : "track", + "uri" : "spotify:track:6DonRyqagGQGdbjMKRy5f7" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/1FrhRifX9s3sjpkoYG9N81" + }, + "href" : "https://api.spotify.com/v1/albums/1FrhRifX9s3sjpkoYG9N81", + "id" : "1FrhRifX9s3sjpkoYG9N81", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/5382502ee28643a22e9082cb680eafde0e45fde8", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/407efbd7bb47d6631c8336f8a9f22c6430166d7b", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/921622d03631fc53ad93bbd9edf0b11c1597ab41", + "width" : 64 + } ], + "name" : "The Reverent Jorfy", + "type" : "album", + "uri" : "spotify:album:1FrhRifX9s3sjpkoYG9N81" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/0aXuMYPvjBGthmsiknR0DY" + }, + "href" : "https://api.spotify.com/v1/artists/0aXuMYPvjBGthmsiknR0DY", + "id" : "0aXuMYPvjBGthmsiknR0DY", + "name" : "Andy Gordon", + "type" : "artist", + "uri" : "spotify:artist:0aXuMYPvjBGthmsiknR0DY" + }, { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 282493, + "explicit" : false, + "external_ids" : { + "isrc" : "GBKPL1373490" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2mlNUVIHh7zm66aMx3U2Nv" + }, + "href" : "https://api.spotify.com/v1/tracks/2mlNUVIHh7zm66aMx3U2Nv", + "id" : "2mlNUVIHh7zm66aMx3U2Nv", + "name" : "Waiting in Vain - Live", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/a49336c90d63698ee372242d11b66e64568458f8", + "track_number" : 3, + "type" : "track", + "uri" : "spotify:track:2mlNUVIHh7zm66aMx3U2Nv" + } ], + "limit" : 20, + "next" : null, + "offset" : 0, + "previous" : null, + "total" : 12 + } +} \ No newline at end of file diff --git a/src/test/fixtures/search-track.json b/src/test/fixtures/search-track.json new file mode 100644 index 000000000..a86eb04be --- /dev/null +++ b/src/test/fixtures/search-track.json @@ -0,0 +1,656 @@ +{ + "tracks" : { + "href" : "https://api.spotify.com/v1/search?query=tania+bowra&offset=0&limit=20&type=track", + "items" : [ { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 276773, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410001" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2TpxZ7JUBn3uw46aR7qd6V" + }, + "href" : "https://api.spotify.com/v1/tracks/2TpxZ7JUBn3uw46aR7qd6V", + "id" : "2TpxZ7JUBn3uw46aR7qd6V", + "name" : "All I Want", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/6d00206e32194d15df329d4770e4fa1f2ced3f57", + "track_number" : 1, + "type" : "track", + "uri" : "spotify:track:2TpxZ7JUBn3uw46aR7qd6V" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 247680, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410002" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/4PjcfyZZVE10TFd9EKA72r" + }, + "href" : "https://api.spotify.com/v1/tracks/4PjcfyZZVE10TFd9EKA72r", + "id" : "4PjcfyZZVE10TFd9EKA72r", + "name" : "Someday", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/2b15de922bf4f4b8cfe09c8448079b8ff7a45a5f", + "track_number" : 2, + "type" : "track", + "uri" : "spotify:track:4PjcfyZZVE10TFd9EKA72r" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 204093, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410003" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2tniUNfN0hmqavFuJ2NodO" + }, + "href" : "https://api.spotify.com/v1/tracks/2tniUNfN0hmqavFuJ2NodO", + "id" : "2tniUNfN0hmqavFuJ2NodO", + "name" : "Wet Wood", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/330aa73c34f81c164f00f7cf4e3de1368e59ff20", + "track_number" : 3, + "type" : "track", + "uri" : "spotify:track:2tniUNfN0hmqavFuJ2NodO" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 240253, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410004" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/1irrhbi54Uwsrky0s3SrPz" + }, + "href" : "https://api.spotify.com/v1/tracks/1irrhbi54Uwsrky0s3SrPz", + "id" : "1irrhbi54Uwsrky0s3SrPz", + "name" : "Give It 2 Me", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/2f0bd7efcd2addda3330990366b81df3fdc37c8c", + "track_number" : 4, + "type" : "track", + "uri" : "spotify:track:1irrhbi54Uwsrky0s3SrPz" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 220173, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410005" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/4JAJ6ujlF593H31kA4UhjR" + }, + "href" : "https://api.spotify.com/v1/tracks/4JAJ6ujlF593H31kA4UhjR", + "id" : "4JAJ6ujlF593H31kA4UhjR", + "name" : "Be Mine", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/271590224d1b24af07b777ffc744191cda49c9b4", + "track_number" : 5, + "type" : "track", + "uri" : "spotify:track:4JAJ6ujlF593H31kA4UhjR" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 281946, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410006" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/6UbiYwgZJrwqB5ILDVk1e5" + }, + "href" : "https://api.spotify.com/v1/tracks/6UbiYwgZJrwqB5ILDVk1e5", + "id" : "6UbiYwgZJrwqB5ILDVk1e5", + "name" : "Desire", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/22ae385689d8ac4f3919ad26057edf215a70e912", + "track_number" : 6, + "type" : "track", + "uri" : "spotify:track:6UbiYwgZJrwqB5ILDVk1e5" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 189240, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410007" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/0WIfmQdGqTbZQjjoSxM8hB" + }, + "href" : "https://api.spotify.com/v1/tracks/0WIfmQdGqTbZQjjoSxM8hB", + "id" : "0WIfmQdGqTbZQjjoSxM8hB", + "name" : "Eastside", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/46b2b6e73675680a136a640fad9b96adb4db37ae", + "track_number" : 7, + "type" : "track", + "uri" : "spotify:track:0WIfmQdGqTbZQjjoSxM8hB" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 230440, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410008" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/1Xan3mf1E173v2n4wbQFeO" + }, + "href" : "https://api.spotify.com/v1/tracks/1Xan3mf1E173v2n4wbQFeO", + "id" : "1Xan3mf1E173v2n4wbQFeO", + "name" : "Easy Way", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/1926686f64b709f529d94b8af39398a7d5551fc8", + "track_number" : 8, + "type" : "track", + "uri" : "spotify:track:1Xan3mf1E173v2n4wbQFeO" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 281320, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410009" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5cBLGuA6AFlZISzkRiE7IT" + }, + "href" : "https://api.spotify.com/v1/tracks/5cBLGuA6AFlZISzkRiE7IT", + "id" : "5cBLGuA6AFlZISzkRiE7IT", + "name" : "Sympathy", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/b55ab54cf457eb8a178fefbbbf32c52f64be9d5d", + "track_number" : 9, + "type" : "track", + "uri" : "spotify:track:5cBLGuA6AFlZISzkRiE7IT" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 262400, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410010" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/3Wlw9nfntmKxVxLMzZeYLB" + }, + "href" : "https://api.spotify.com/v1/tracks/3Wlw9nfntmKxVxLMzZeYLB", + "id" : "3Wlw9nfntmKxVxLMzZeYLB", + "name" : "Pleasure And Pain", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/df9af685d4481ca17218b351263562f4b774adea", + "track_number" : 10, + "type" : "track", + "uri" : "spotify:track:3Wlw9nfntmKxVxLMzZeYLB" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 240973, + "explicit" : false, + "external_ids" : { + "isrc" : "AUCR10410011" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/6DonRyqagGQGdbjMKRy5f7" + }, + "href" : "https://api.spotify.com/v1/tracks/6DonRyqagGQGdbjMKRy5f7", + "id" : "6DonRyqagGQGdbjMKRy5f7", + "name" : "Peace Like A Summer Breeze", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/77823e8af90501f950c324eb96ac600af8004a36", + "track_number" : 11, + "type" : "track", + "uri" : "spotify:track:6DonRyqagGQGdbjMKRy5f7" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/1FrhRifX9s3sjpkoYG9N81" + }, + "href" : "https://api.spotify.com/v1/albums/1FrhRifX9s3sjpkoYG9N81", + "id" : "1FrhRifX9s3sjpkoYG9N81", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/5382502ee28643a22e9082cb680eafde0e45fde8", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/407efbd7bb47d6631c8336f8a9f22c6430166d7b", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/921622d03631fc53ad93bbd9edf0b11c1597ab41", + "width" : 64 + } ], + "name" : "The Reverent Jorfy", + "type" : "album", + "uri" : "spotify:album:1FrhRifX9s3sjpkoYG9N81" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/0aXuMYPvjBGthmsiknR0DY" + }, + "href" : "https://api.spotify.com/v1/artists/0aXuMYPvjBGthmsiknR0DY", + "id" : "0aXuMYPvjBGthmsiknR0DY", + "name" : "Andy Gordon", + "type" : "artist", + "uri" : "spotify:artist:0aXuMYPvjBGthmsiknR0DY" + }, { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" + }, + "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", + "id" : "08td7MxkoHQkXnWAYD8d6Q", + "name" : "Tania Bowra", + "type" : "artist", + "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 282493, + "explicit" : false, + "external_ids" : { + "isrc" : "GBKPL1373490" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/2mlNUVIHh7zm66aMx3U2Nv" + }, + "href" : "https://api.spotify.com/v1/tracks/2mlNUVIHh7zm66aMx3U2Nv", + "id" : "2mlNUVIHh7zm66aMx3U2Nv", + "name" : "Waiting in Vain - Live", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/a49336c90d63698ee372242d11b66e64568458f8", + "track_number" : 3, + "type" : "track", + "uri" : "spotify:track:2mlNUVIHh7zm66aMx3U2Nv" + } ], + "limit" : 20, + "next" : null, + "offset" : 0, + "previous" : null, + "total" : 12 + } +} \ No newline at end of file diff --git a/src/test/java/se/michaelthelin/spotify/methods/AlbumSearchRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/AlbumSearchRequestTest.java index 2e574b1f1..90ebf00a5 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/AlbumSearchRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/AlbumSearchRequestTest.java @@ -11,6 +11,7 @@ import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.models.Album; import se.michaelthelin.spotify.models.Page; +import se.michaelthelin.spotify.models.SimpleAlbum; import java.util.List; import java.util.concurrent.CountDownLatch; @@ -30,17 +31,17 @@ public void shouldGetAlbumsResult_async() throws Exception { final CountDownLatch asyncCompleted = new CountDownLatch(1); - final SettableFuture> searchResultFuture = request.getAlbumsPageAsync(); + final SettableFuture> searchResultFuture = request.getAsync(); - Futures.addCallback(searchResultFuture, new FutureCallback>() { + Futures.addCallback(searchResultFuture, new FutureCallback>() { @Override - public void onSuccess(Page albumSearchResult) { - List albums = albumSearchResult.getItems(); + public void onSuccess(Page albumSearchResult) { + List albums = albumSearchResult.getItems(); assertEquals(1, albums.size()); - Album firstAlbum = albums.get(0); - assertEquals("68NlXKRuJ1YqrhIbwe864y", firstAlbum.getId()); + SimpleAlbum firstAlbum = albums.get(0); + assertEquals("6akEvsycLGftJxYudPjmqK", firstAlbum.getId()); asyncCompleted.countDown(); } @@ -60,14 +61,14 @@ public void shouldGetAlbumsResult_sync() throws Exception { final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-album.json"); final AlbumSearchRequest request = api.searchAlbums("The Best Of Keane").httpManager(mockedHttpManager).build(); - final Page albumSearchResult = request.getAlbumsPage(); + final Page albumSearchResult = request.getPage(); - final List albums = albumSearchResult.getItems(); + final List albums = albumSearchResult.getItems(); assertEquals(1, albums.size()); - final Album firstAlbum = albums.get(0); - assertEquals("68NlXKRuJ1YqrhIbwe864y", firstAlbum.getId()); + final SimpleAlbum firstAlbum = albums.get(0); + assertEquals("6akEvsycLGftJxYudPjmqK", firstAlbum.getId()); } } diff --git a/src/test/java/se/michaelthelin/spotify/methods/AlbumsForArtistsRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/AlbumsForArtistsRequestTest.java index d77493bb9..53b293679 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/AlbumsForArtistsRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/AlbumsForArtistsRequestTest.java @@ -11,6 +11,7 @@ import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.models.Album; import se.michaelthelin.spotify.models.Page; +import se.michaelthelin.spotify.models.SimpleAlbum; import java.util.List; import java.util.concurrent.CountDownLatch; @@ -31,17 +32,17 @@ public void shouldGetAlbumResultForArtistId_async() throws Exception { final CountDownLatch asyncCompleted = new CountDownLatch(1); - final SettableFuture> albumsFuture = request.getAsync(); + final SettableFuture> albumsFuture = request.getAsync(); - Futures.addCallback(albumsFuture, new FutureCallback>() { + Futures.addCallback(albumsFuture, new FutureCallback>() { @Override - public void onSuccess(Page albumSearchResult) { - List albums = albumSearchResult.getItems(); + public void onSuccess(Page albumSearchResult) { + List albums = albumSearchResult.getItems(); assertEquals(1, albums.size()); - Album firstAlbum = albums.get(0); - assertEquals("68NlXKRuJ1YqrhIbwe864y", firstAlbum.getId()); + SimpleAlbum firstAlbum = albums.get(0); + assertEquals("6akEvsycLGftJxYudPjmqK", firstAlbum.getId()); asyncCompleted.countDown(); } @@ -61,14 +62,14 @@ public void shouldGetAlbumResultForArtistId_sync() throws Exception { final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-album.json"); final AlbumsForArtistRequest request = api.getAlbumsForArtist("53A0W3U0s8diEn9RhXQhVz").httpManager(mockedHttpManager).build(); - final Page albumsPage = request.get(); + final Page albumsPage = request.get(); - final List albums = albumsPage.getItems(); + final List albums = albumsPage.getItems(); assertEquals(1, albums.size()); - final Album firstAlbum = albums.get(0); - assertEquals("68NlXKRuJ1YqrhIbwe864y", firstAlbum.getId()); + final SimpleAlbum firstAlbum = albums.get(0); + assertEquals("6akEvsycLGftJxYudPjmqK", firstAlbum.getId()); } } diff --git a/src/test/java/se/michaelthelin/spotify/methods/TrackSearchRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/TrackSearchRequestTest.java index e6d1bee0d..29186439d 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/TrackSearchRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/TrackSearchRequestTest.java @@ -25,7 +25,7 @@ public class TrackSearchRequestTest { @Test public void shouldGetTracksResult_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-track-page1.json"); + final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-track.json"); final TrackSearchRequest request = api.searchTracks("Mr. Brightside").httpManager(mockedHttpManager).build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -37,13 +37,13 @@ public void shouldGetTracksResult_async() throws Exception { public void onSuccess(Page trackSearchResult) { List tracks = trackSearchResult.getItems(); - assertEquals(20, tracks.size()); + assertEquals(12, tracks.size()); Track firstTrack = tracks.get(0); - assertEquals("0eGsygTp906u18L0Oimnem", firstTrack.getId()); + assertEquals("2TpxZ7JUBn3uw46aR7qd6V", firstTrack.getId()); Track secondTrack = tracks.get(1); - assertEquals("5zvJ6DUahHHjeknQPn7iAH", secondTrack.getId()); + assertEquals("4PjcfyZZVE10TFd9EKA72r", secondTrack.getId()); asyncCompleted.countDown(); } @@ -60,20 +60,20 @@ public void onFailure(Throwable throwable) { @Test public void shouldGetTracksResult_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-track-page1.json"); + final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-track.json"); final TrackSearchRequest request = api.searchTracks("Mr. Brightside").httpManager(mockedHttpManager).build(); final Page trackSearchResult = request.get(); final List tracks = trackSearchResult.getItems(); - assertEquals(20, tracks.size()); + assertEquals(12, tracks.size()); final Track firstTrack = tracks.get(0); - assertEquals("0eGsygTp906u18L0Oimnem", firstTrack.getId()); + assertEquals("2TpxZ7JUBn3uw46aR7qd6V", firstTrack.getId()); final Track secondTrack = tracks.get(1); - assertEquals("5zvJ6DUahHHjeknQPn7iAH", secondTrack.getId()); + assertEquals("4PjcfyZZVE10TFd9EKA72r", secondTrack.getId()); } } From cbf27f274b5a7cd1838c215f51dd8772cc66de16 Mon Sep 17 00:00:00 2001 From: Michael Thelin Date: Fri, 16 May 2014 21:45:31 +0200 Subject: [PATCH 03/10] Optionally run album tests against live instead of mock --- .../spotify/TestConfiguration.java | 7 ++++ .../spotify/methods/AlbumRequestTest.java | 33 ++++++++++++++----- 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 src/test/java/se/michaelthelin/spotify/TestConfiguration.java diff --git a/src/test/java/se/michaelthelin/spotify/TestConfiguration.java b/src/test/java/se/michaelthelin/spotify/TestConfiguration.java new file mode 100644 index 000000000..0c17847b7 --- /dev/null +++ b/src/test/java/se/michaelthelin/spotify/TestConfiguration.java @@ -0,0 +1,7 @@ +package se.michaelthelin.spotify; + +public class TestConfiguration { + + public static boolean USE_MOCK_RESPONSES = false; + +} diff --git a/src/test/java/se/michaelthelin/spotify/methods/AlbumRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/AlbumRequestTest.java index 2f202b821..9cc7e4d8c 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/AlbumRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/AlbumRequestTest.java @@ -8,6 +8,7 @@ import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.exceptions.BadFieldException; import se.michaelthelin.spotify.exceptions.NotFoundException; @@ -25,8 +26,12 @@ public class AlbumRequestTest { public void shouldGetAlbumResult_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("album.json"); - final AlbumRequest request = api.getAlbum("7e0ij2fpWaxOEHv5fUYZjd").httpManager(mockedHttpManager).build(); + final AlbumRequest.Builder requestBuilder = api.getAlbum("0sNOF9WDwhWunNAHPD3Baj"); + + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("album.json")); + } + final AlbumRequest request = requestBuilder.build(); final SettableFuture albumFuture = request.getAsync(); @@ -54,8 +59,12 @@ public void onFailure(Throwable throwable) { public void shouldFailForNonExistingAlbumId_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("error_id-not-found.json"); - final AlbumRequest request = api.getAlbum("7e0ij2fpWaxOEHv5fUYZjd").httpManager(mockedHttpManager).build(); + final AlbumRequest.Builder requestBuilder = api.getAlbum("nonexistingid"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("error_id-not-found.json")); + } + + final AlbumRequest request = requestBuilder.build(); final SettableFuture albumFuture = request.getAsync(); @@ -82,8 +91,11 @@ public void onFailure(Throwable throwable) { public void shouldFailForBadField_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("error_bad-field.json"); - final AlbumRequest request = api.getAlbum("7e0ij2fpWaxOEHv5fUYZjd").httpManager(mockedHttpManager).build(); + final AlbumRequest.Builder requestBuilder = api.getAlbum("你好"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("error_bad-field.json")); + } + final AlbumRequest request = requestBuilder.build(); final SettableFuture albumFuture = request.getAsync(); @@ -110,10 +122,15 @@ public void onFailure(Throwable throwable) { public void shouldGetAlbumResult_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("album.json"); - final AlbumRequest request = api.getAlbum("7e0ij2fpWaxOEHv5fUYZjd").httpManager(mockedHttpManager).build(); + final AlbumRequest.Builder requestBuilder = api.getAlbum("0sNOF9WDwhWunNAHPD3Baj"); + + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("album.json")); + } + AlbumRequest request = requestBuilder.build(); Album album = request.get(); + assertNotNull(album); assertEquals("0sNOF9WDwhWunNAHPD3Baj", album.getId()); } From 7fece77168a2e5010ffe438bce3101a050b67897 Mon Sep 17 00:00:00 2001 From: Michael Thelin Date: Fri, 16 May 2014 22:13:33 +0200 Subject: [PATCH 04/10] Optionally run album search test against live instead of mock --- search-album.json | 0 .../se/michaelthelin/spotify/JsonUtil.java | 2 +- .../spotify/methods/AlbumSearchRequest.java | 5 +- .../spotify/models/ExternalUrls.java | 4 ++ src/test/fixtures/search-album.json | 64 +++++++++---------- .../spotify/methods/AlbumRequestTest.java | 1 - .../methods/AlbumSearchRequestTest.java | 48 +++++++++++--- 7 files changed, 78 insertions(+), 46 deletions(-) create mode 100644 search-album.json diff --git a/search-album.json b/search-album.json new file mode 100644 index 000000000..e69de29bb diff --git a/src/main/java/se/michaelthelin/spotify/JsonUtil.java b/src/main/java/se/michaelthelin/spotify/JsonUtil.java index a41cffaa4..cc68d3187 100644 --- a/src/main/java/se/michaelthelin/spotify/JsonUtil.java +++ b/src/main/java/se/michaelthelin/spotify/JsonUtil.java @@ -191,7 +191,7 @@ public static SimpleAlbum createSimpleAlbum(JSONObject simpleAlbumJson) { simpleAlbum.setImages(createImages(simpleAlbumJson.getJSONArray("images"))); simpleAlbum.setName(simpleAlbumJson.getString("name")); simpleAlbum.setType(createSpotifyEntityType(simpleAlbumJson.getString("type"))); - simpleAlbum.setUri(simpleAlbumJson.getString("type")); + simpleAlbum.setUri(simpleAlbumJson.getString("uri")); return simpleAlbum; } diff --git a/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java b/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java index 70a374e8e..307df3786 100644 --- a/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java +++ b/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java @@ -32,7 +32,7 @@ public SettableFuture> getAsync() { return searchResultFuture; } - public Page getPage() throws IOException, UnexpectedResponseException { + public Page get() throws IOException, UnexpectedResponseException { return JsonUtil.createSimpleAlbumPage(getJson()); } @@ -45,9 +45,8 @@ public static final class Builder extends AbstractRequest.Builder { public Builder query(String query) { assert (query != null); path("/v1/search"); - String massagedQuery = query.replace(" ", "+"); parameter("type","album"); - return parameter("q", massagedQuery); + return parameter("q", query); } public Builder limit(int limit) { diff --git a/src/main/java/se/michaelthelin/spotify/models/ExternalUrls.java b/src/main/java/se/michaelthelin/spotify/models/ExternalUrls.java index e5f01aef0..e321e25c4 100644 --- a/src/main/java/se/michaelthelin/spotify/models/ExternalUrls.java +++ b/src/main/java/se/michaelthelin/spotify/models/ExternalUrls.java @@ -11,4 +11,8 @@ public Map getExternalUrls() { return externalUrls; } + public String get(String key) { + return externalUrls.get(key); + } + } diff --git a/src/test/fixtures/search-album.json b/src/test/fixtures/search-album.json index 4cfeac324..6ab561e43 100644 --- a/src/test/fixtures/search-album.json +++ b/src/test/fixtures/search-album.json @@ -1,34 +1,34 @@ { - "albums" : { - "href" : "https://api.spotify.com/v1/search?query=tania+bowra&offset=0&limit=20&type=album", - "items" : [ { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - } ], - "limit" : 20, - "next" : null, - "offset" : 0, - "previous" : null, - "total" : 1 - } + "albums" : { + "href" : "https://api.spotify.com/v1/search?query=tania+bowra&offset=0&limit=20&type=album", + "items" : [ { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" + }, + "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", + "id" : "6akEvsycLGftJxYudPjmqK", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", + "width" : 64 + } ], + "name" : "Place In The Sun", + "type" : "album", + "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" + } ], + "limit" : 20, + "next" : null, + "offset" : 0, + "previous" : null, + "total" : 1 + } } \ No newline at end of file diff --git a/src/test/java/se/michaelthelin/spotify/methods/AlbumRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/AlbumRequestTest.java index 9cc7e4d8c..403e47f16 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/AlbumRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/AlbumRequestTest.java @@ -7,7 +7,6 @@ import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; -import se.michaelthelin.spotify.HttpManager; import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.exceptions.BadFieldException; diff --git a/src/test/java/se/michaelthelin/spotify/methods/AlbumSearchRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/AlbumSearchRequestTest.java index 90ebf00a5..f481674bb 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/AlbumSearchRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/AlbumSearchRequestTest.java @@ -8,10 +8,11 @@ import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; -import se.michaelthelin.spotify.models.Album; import se.michaelthelin.spotify.models.Page; import se.michaelthelin.spotify.models.SimpleAlbum; +import se.michaelthelin.spotify.models.SpotifyEntityType; import java.util.List; import java.util.concurrent.CountDownLatch; @@ -26,8 +27,12 @@ public class AlbumSearchRequestTest { @Test public void shouldGetAlbumsResult_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-album.json"); - final AlbumSearchRequest request = api.searchAlbums("The Best Of Keane").httpManager(mockedHttpManager).build(); + + final AlbumSearchRequest.Builder requestBuilder = api.searchAlbums("tania bowra"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("search-album.json")); + } + final AlbumSearchRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -36,12 +41,23 @@ public void shouldGetAlbumsResult_async() throws Exception { Futures.addCallback(searchResultFuture, new FutureCallback>() { @Override public void onSuccess(Page albumSearchResult) { - List albums = albumSearchResult.getItems(); + assertEquals("https://api.spotify.com/v1/search?query=tania+bowra&offset=0&limit=20&type=album", albumSearchResult.getHref()); + assertEquals(20, albumSearchResult.getLimit()); + assertEquals(0, albumSearchResult.getOffset()); + assertEquals("null", albumSearchResult.getNext()); + assertEquals("null", albumSearchResult.getPrevious()); + assertEquals(1, albumSearchResult.getTotal()); + List albums = albumSearchResult.getItems(); assertEquals(1, albums.size()); SimpleAlbum firstAlbum = albums.get(0); + assertEquals("https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK", firstAlbum.getExternalUrls().get("spotify")); + assertEquals("https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", firstAlbum.getHref()); assertEquals("6akEvsycLGftJxYudPjmqK", firstAlbum.getId()); + assertEquals("Place In The Sun", firstAlbum.getName()); + assertEquals(SpotifyEntityType.ALBUM, firstAlbum.getType()); + assertEquals("spotify:album:6akEvsycLGftJxYudPjmqK", firstAlbum.getUri()); asyncCompleted.countDown(); } @@ -58,17 +74,31 @@ public void onFailure(Throwable throwable) { @Test public void shouldGetAlbumsResult_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-album.json"); - final AlbumSearchRequest request = api.searchAlbums("The Best Of Keane").httpManager(mockedHttpManager).build(); - final Page albumSearchResult = request.getPage(); + final AlbumSearchRequest.Builder requestBuilder = api.searchAlbums("tania bowra"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("search-album.json")).build(); + } + final AlbumSearchRequest request = requestBuilder.build(); - final List albums = albumSearchResult.getItems(); + final Page albumSearchResult = request.get(); + assertEquals("https://api.spotify.com/v1/search?query=tania+bowra&offset=0&limit=20&type=album", albumSearchResult.getHref()); + assertEquals(20, albumSearchResult.getLimit()); + assertEquals(0, albumSearchResult.getOffset()); + assertEquals("null", albumSearchResult.getNext()); + assertEquals("null", albumSearchResult.getPrevious()); + assertEquals(1, albumSearchResult.getTotal()); + final List albums = albumSearchResult.getItems(); assertEquals(1, albums.size()); - final SimpleAlbum firstAlbum = albums.get(0); + SimpleAlbum firstAlbum = albums.get(0); + assertEquals("https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK", firstAlbum.getExternalUrls().get("spotify")); + assertEquals("https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", firstAlbum.getHref()); assertEquals("6akEvsycLGftJxYudPjmqK", firstAlbum.getId()); + assertEquals("Place In The Sun", firstAlbum.getName()); + assertEquals(SpotifyEntityType.ALBUM, firstAlbum.getType()); + assertEquals("spotify:album:6akEvsycLGftJxYudPjmqK", firstAlbum.getUri()); } } From 248e9af5403741a228c7013455b1a359278901de Mon Sep 17 00:00:00 2001 From: Michael Thelin Date: Fri, 16 May 2014 23:01:51 +0200 Subject: [PATCH 05/10] Optionally run album for artist search against live instead of mock --- .../se/michaelthelin/spotify/JsonUtil.java | 14 ++--- .../spotify/methods/AlbumSearchRequest.java | 4 +- .../spotify/methods/ArtistSearchRequest.java | 4 +- src/test/fixtures/artist-album.json | 55 ++++++++++++++++ .../methods/AlbumsForArtistsRequestTest.java | 63 +++++++++++++------ 5 files changed, 111 insertions(+), 29 deletions(-) create mode 100644 src/test/fixtures/artist-album.json diff --git a/src/main/java/se/michaelthelin/spotify/JsonUtil.java b/src/main/java/se/michaelthelin/spotify/JsonUtil.java index cc68d3187..5302fc757 100644 --- a/src/main/java/se/michaelthelin/spotify/JsonUtil.java +++ b/src/main/java/se/michaelthelin/spotify/JsonUtil.java @@ -116,7 +116,7 @@ private static Album createAlbum(JSONObject albumJson) { album.setName(albumJson.getString("name")); album.setPopularity(albumJson.getInt("popularity")); album.setReleaseDate(createReleaseDate(albumJson.getJSONObject("release_date"))); - album.setTracks(createSimpleTrackPage(albumJson)); + album.setTracks(createSimpleTrackPage(albumJson.getJSONObject("tracks"))); album.setType(createSpotifyEntityType(albumJson.getString("type"))); album.setUri(albumJson.getString("uri")); @@ -346,14 +346,14 @@ public static Page createArtistPage(String artistPageJson) { } public static Page createArtistPage(JSONObject artistPageJson) { - Page page = createItemlessPage(artistPageJson.getJSONObject("artists")); - page.setItems(createArtists(artistPageJson.getJSONObject("artists").getJSONArray("items"))); + Page page = createItemlessPage(artistPageJson); + page.setItems(createArtists(artistPageJson.getJSONArray("items"))); return page; } private static Page createSimpleTrackPage(JSONObject simpleTrackPageJson) { - Page page = createItemlessPage(simpleTrackPageJson.getJSONObject("tracks")); - page.setItems(createSimpleTracks(simpleTrackPageJson.getJSONObject("tracks").getJSONArray("items"))); + Page page = createItemlessPage(simpleTrackPageJson); + page.setItems(createSimpleTracks(simpleTrackPageJson.getJSONArray("items"))); return page; } @@ -362,8 +362,8 @@ public static Page createSimpleAlbumPage(String simpleAlbumPageJson } public static Page createSimpleAlbumPage(JSONObject simpleAlbumPageJson) { - Page page = createItemlessPage(simpleAlbumPageJson.getJSONObject("albums")); - page.setItems(createSimpleAlbums(simpleAlbumPageJson.getJSONObject("albums").getJSONArray("items"))); + Page page = createItemlessPage(simpleAlbumPageJson); + page.setItems(createSimpleAlbums(simpleAlbumPageJson.getJSONArray("items"))); return page; } diff --git a/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java b/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java index 307df3786..71f00e7ec 100644 --- a/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java +++ b/src/main/java/se/michaelthelin/spotify/methods/AlbumSearchRequest.java @@ -22,7 +22,7 @@ public SettableFuture> getAsync() { try { String jsonString = getJson(); JSONObject jsonObject = JSONObject.fromObject(jsonString); - searchResultFuture.set(JsonUtil.createSimpleAlbumPage(jsonObject)); + searchResultFuture.set(JsonUtil.createSimpleAlbumPage(jsonObject.getJSONObject("albums"))); } catch (IOException e) { searchResultFuture.setException(e); } catch (UnexpectedResponseException e) { @@ -33,7 +33,7 @@ public SettableFuture> getAsync() { } public Page get() throws IOException, UnexpectedResponseException { - return JsonUtil.createSimpleAlbumPage(getJson()); + return JsonUtil.createSimpleAlbumPage(JSONObject.fromObject(getJson()).getJSONObject("albums")); } public static Builder builder() { diff --git a/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java b/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java index 47e788130..8f38e3c56 100644 --- a/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java +++ b/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java @@ -22,7 +22,7 @@ public SettableFuture> getAsync() { try { String jsonString = getJson(); JSONObject jsonObject = JSONObject.fromObject(jsonString); - searchResultFuture.set(JsonUtil.createArtistPage(jsonObject)); + searchResultFuture.set(JsonUtil.createArtistPage(jsonObject.getJSONObject("artists"))); } catch (IOException e) { searchResultFuture.setException(e); } catch (UnexpectedResponseException e) { @@ -33,7 +33,7 @@ public SettableFuture> getAsync() { } public Page get() throws IOException, UnexpectedResponseException { - return JsonUtil.createArtistPage(getJson()); + return JsonUtil.createArtistPage(JSONObject.fromObject(getJson()).getJSONObject("artists")); } public static Builder builder() { diff --git a/src/test/fixtures/artist-album.json b/src/test/fixtures/artist-album.json new file mode 100644 index 000000000..ebe3c4949 --- /dev/null +++ b/src/test/fixtures/artist-album.json @@ -0,0 +1,55 @@ +{ + "href" : "https://api.spotify.com/v1/artists/1vCWHaC5f2uS3yhpwWbIA6/albums?offset=0&limit=2&album_type=single", + "items" : [ { + "album_type" : "single", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/6HVPLh1TXzPnMqY7tAWLoL" + }, + "href" : "https://api.spotify.com/v1/albums/6HVPLh1TXzPnMqY7tAWLoL", + "id" : "6HVPLh1TXzPnMqY7tAWLoL", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/4c252ea56b0276df6043db10747f4daf89714a93", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/cc3db8170a3833140800a2cb291ed51977c6696a", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/12a32170ff25f0e825472d20161cd75db433ee58", + "width" : 64 + } ], + "name" : "Addicted To You", + "type" : "album", + "uri" : "spotify:album:6HVPLh1TXzPnMqY7tAWLoL" + }, { + "album_type" : "single", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/5jvbjb51hQQAIycnBFS4cG" + }, + "href" : "https://api.spotify.com/v1/albums/5jvbjb51hQQAIycnBFS4cG", + "id" : "5jvbjb51hQQAIycnBFS4cG", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/96e309e8f306742de5e23b6235e963c0dcbcf7bc", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8b32f93877ad126a2cecee24484d2bc0ed434e83", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/797051eca4556983cbe70e23844c484c5522d907", + "width" : 64 + } ], + "name" : "Addicted To You (Remixes)", + "type" : "album", + "uri" : "spotify:album:5jvbjb51hQQAIycnBFS4cG" + } ], + "limit" : 2, + "next" : "https://api.spotify.com/v1/artists/1vCWHaC5f2uS3yhpwWbIA6/albums?offset=2&limit=2&album_type=single", + "offset" : 0, + "previous" : null, + "total" : 178 +} \ No newline at end of file diff --git a/src/test/java/se/michaelthelin/spotify/methods/AlbumsForArtistsRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/AlbumsForArtistsRequestTest.java index 53b293679..702ea803b 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/AlbumsForArtistsRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/AlbumsForArtistsRequestTest.java @@ -7,9 +7,9 @@ import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; -import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; -import se.michaelthelin.spotify.models.Album; +import se.michaelthelin.spotify.models.AlbumType; import se.michaelthelin.spotify.models.Page; import se.michaelthelin.spotify.models.SimpleAlbum; @@ -18,6 +18,7 @@ import java.util.concurrent.TimeUnit; import static junit.framework.Assert.assertEquals; +import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.fail; @RunWith(MockitoJUnitRunner.class) @@ -27,8 +28,11 @@ public class AlbumsForArtistsRequestTest { public void shouldGetAlbumResultForArtistId_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-album.json"); - final AlbumsForArtistRequest request = api.getAlbumsForArtist("53A0W3U0s8diEn9RhXQhVz").httpManager(mockedHttpManager).build(); + final AlbumsForArtistRequest.Builder requestBuilder = api.getAlbumsForArtist("1vCWHaC5f2uS3yhpwWbIA6").limit(2).types(AlbumType.SINGLE); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("artist-album.json")); + } + final AlbumsForArtistRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -37,12 +41,22 @@ public void shouldGetAlbumResultForArtistId_async() throws Exception { Futures.addCallback(albumsFuture, new FutureCallback>() { @Override public void onSuccess(Page albumSearchResult) { - List albums = albumSearchResult.getItems(); + assertEquals("https://api.spotify.com/v1/artists/1vCWHaC5f2uS3yhpwWbIA6/albums?offset=0&limit=2&album_type=single", albumSearchResult.getHref()); + assertEquals(2, albumSearchResult.getLimit()); + assertEquals(0, albumSearchResult.getOffset()); + assertEquals(178, albumSearchResult.getTotal()); + assertEquals("https://api.spotify.com/v1/artists/1vCWHaC5f2uS3yhpwWbIA6/albums?offset=2&limit=2&album_type=single", albumSearchResult.getNext()); + assertEquals("null", albumSearchResult.getPrevious()); - assertEquals(1, albums.size()); + List albums = albumSearchResult.getItems(); + assertEquals(2, albums.size()); SimpleAlbum firstAlbum = albums.get(0); - assertEquals("6akEvsycLGftJxYudPjmqK", firstAlbum.getId()); + assertEquals(AlbumType.SINGLE, firstAlbum.getAlbumType()); + assertEquals("https://open.spotify.com/album/6HVPLh1TXzPnMqY7tAWLoL", firstAlbum.getExternalUrls().get("spotify")); + assertEquals("https://api.spotify.com/v1/albums/6HVPLh1TXzPnMqY7tAWLoL", firstAlbum.getHref()); + assertEquals("6HVPLh1TXzPnMqY7tAWLoL", firstAlbum.getId()); + assertNotNull(firstAlbum.getImages()); asyncCompleted.countDown(); } @@ -59,17 +73,30 @@ public void onFailure(Throwable throwable) { public void shouldGetAlbumResultForArtistId_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-album.json"); - final AlbumsForArtistRequest request = api.getAlbumsForArtist("53A0W3U0s8diEn9RhXQhVz").httpManager(mockedHttpManager).build(); - - final Page albumsPage = request.get(); - - final List albums = albumsPage.getItems(); - - assertEquals(1, albums.size()); - - final SimpleAlbum firstAlbum = albums.get(0); - assertEquals("6akEvsycLGftJxYudPjmqK", firstAlbum.getId()); + final AlbumsForArtistRequest.Builder requestBuilder = api.getAlbumsForArtist("1vCWHaC5f2uS3yhpwWbIA6").limit(2).types(AlbumType.SINGLE); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("artist-album.json")); + } + final AlbumsForArtistRequest request = requestBuilder.build(); + + final Page albumSearchResult = request.get(); + + assertEquals("https://api.spotify.com/v1/artists/1vCWHaC5f2uS3yhpwWbIA6/albums?offset=0&limit=2&album_type=single", albumSearchResult.getHref()); + assertEquals(2, albumSearchResult.getLimit()); + assertEquals(0, albumSearchResult.getOffset()); + assertEquals(178, albumSearchResult.getTotal()); + assertEquals("https://api.spotify.com/v1/artists/1vCWHaC5f2uS3yhpwWbIA6/albums?offset=2&limit=2&album_type=single", albumSearchResult.getNext()); + assertEquals("null", albumSearchResult.getPrevious()); + + final List albums = albumSearchResult.getItems(); + assertEquals(2, albums.size()); + + SimpleAlbum firstAlbum = albums.get(0); + assertEquals(AlbumType.SINGLE, firstAlbum.getAlbumType()); + assertEquals("https://open.spotify.com/album/6HVPLh1TXzPnMqY7tAWLoL", firstAlbum.getExternalUrls().get("spotify")); + assertEquals("https://api.spotify.com/v1/albums/6HVPLh1TXzPnMqY7tAWLoL", firstAlbum.getHref()); + assertEquals("6HVPLh1TXzPnMqY7tAWLoL", firstAlbum.getId()); + assertNotNull(firstAlbum.getImages()); } } From ff399e9519e769fae58a01c2d8ef01fbe07bd342 Mon Sep 17 00:00:00 2001 From: Michael Thelin Date: Fri, 16 May 2014 23:22:05 +0200 Subject: [PATCH 06/10] Bugfix for releasedates and make some tests for multigetting albums able to run against live --- .../se/michaelthelin/spotify/JsonUtil.java | 8 ++++-- .../spotify/models/ReleaseDate.java | 12 ++++----- .../spotify/methods/AlbumsRequestTest.java | 27 ++++++++++++++++--- 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/main/java/se/michaelthelin/spotify/JsonUtil.java b/src/main/java/se/michaelthelin/spotify/JsonUtil.java index 5302fc757..a197a66a2 100644 --- a/src/main/java/se/michaelthelin/spotify/JsonUtil.java +++ b/src/main/java/se/michaelthelin/spotify/JsonUtil.java @@ -156,10 +156,14 @@ public static ReleaseDate createReleaseDate(JSONObject releaseDateJson) { releaseDate.setYear(releaseDateJson.getInt("year")); if (releaseDateJson.has("month") && !releaseDateJson.get("month").equals("null")) { releaseDate.setMonth(releaseDateJson.getInt("month")); + } else { + releaseDate.setMonth(null); } - if (releaseDateJson.has("date") && !releaseDateJson.get("date").equals("null")) { - releaseDate.setDate(releaseDateJson.getInt("date")); + if (releaseDateJson.has("day") && !releaseDateJson.get("day").equals("null")) { + releaseDate.setDate(releaseDateJson.getInt("day")); + } else { + releaseDate.setDate(null); } return releaseDate; diff --git a/src/main/java/se/michaelthelin/spotify/models/ReleaseDate.java b/src/main/java/se/michaelthelin/spotify/models/ReleaseDate.java index 0857b2252..0721538ef 100644 --- a/src/main/java/se/michaelthelin/spotify/models/ReleaseDate.java +++ b/src/main/java/se/michaelthelin/spotify/models/ReleaseDate.java @@ -2,23 +2,23 @@ public class ReleaseDate { - private int date; - private int month; + private Integer date; + private Integer month; private int year; - public int getDate() { + public Integer getDate() { return date; } - public void setDate(int date) { + public void setDate(Integer date) { this.date = date; } - public int getMonth() { + public Integer getMonth() { return month; } - public void setMonth(int month) { + public void setMonth(Integer month) { this.month = month; } diff --git a/src/test/java/se/michaelthelin/spotify/methods/AlbumsRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/AlbumsRequestTest.java index 00d917b3e..178e2a06c 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/AlbumsRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/AlbumsRequestTest.java @@ -9,16 +9,18 @@ import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.exceptions.BadFieldException; import se.michaelthelin.spotify.exceptions.NotFoundException; -import se.michaelthelin.spotify.models.Album; +import se.michaelthelin.spotify.models.*; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import static junit.framework.Assert.assertEquals; +import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; @RunWith(MockitoJUnitRunner.class) @@ -28,8 +30,11 @@ public class AlbumsRequestTest { public void shouldGetAlbumResultForIds_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("albums.json"); - final AlbumsRequest request = api.getAlbums("41MnTivkwTO3UUJ8DrqEJJ").httpManager(mockedHttpManager).build(); + final AlbumsRequest.Builder requestBuilder = api.getAlbums("41MnTivkwTO3UUJ8DrqEJJ"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("albums.json")); + } + final AlbumsRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -42,6 +47,22 @@ public void onSuccess(List albums) { Album firstAlbum = albums.get(0); assertEquals("41MnTivkwTO3UUJ8DrqEJJ", firstAlbum.getId()); + assertEquals(AlbumType.ALBUM, firstAlbum.getAlbumType()); + assertTrue(firstAlbum.getReleaseDate().getDate().equals(8)); + assertTrue(firstAlbum.getReleaseDate().getMonth().equals(11)); + assertEquals(2013, firstAlbum.getReleaseDate().getYear()); + + List artists = firstAlbum.getArtists(); + SimpleArtist firstArtist = artists.get(0); + assertEquals("https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", firstArtist.getHref()); + assertEquals("53A0W3U0s8diEn9RhXQhVz", firstArtist.getId()); + + Page tracksPage = firstAlbum.getTracks(); + assertEquals("https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=0&limit=50", tracksPage.getHref()); + assertEquals(0, tracksPage.getOffset()); + assertEquals(50, tracksPage.getLimit()); + assertEquals(38, tracksPage.getTotal()); + assertEquals("4r9PmSmbAOOWqaGWLf6M9Q", tracksPage.getItems().get(0).getId()); asyncCompleted.countDown(); } From b5555a412a01ac16b4c7f441e91487d51651308c Mon Sep 17 00:00:00 2001 From: Michael Thelin Date: Fri, 16 May 2014 23:46:12 +0200 Subject: [PATCH 07/10] Optional to run multiget albums against live instead of mock --- src/test/fixtures/albums-none-found.json | 3 ++ .../spotify/TestConfiguration.java | 2 +- .../spotify/methods/AlbumsRequestTest.java | 46 +++++++++++++++---- 3 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 src/test/fixtures/albums-none-found.json diff --git a/src/test/fixtures/albums-none-found.json b/src/test/fixtures/albums-none-found.json new file mode 100644 index 000000000..2b97b1eb9 --- /dev/null +++ b/src/test/fixtures/albums-none-found.json @@ -0,0 +1,3 @@ +{ + "albums" : [ null ] +} \ No newline at end of file diff --git a/src/test/java/se/michaelthelin/spotify/TestConfiguration.java b/src/test/java/se/michaelthelin/spotify/TestConfiguration.java index 0c17847b7..5ad754a21 100644 --- a/src/test/java/se/michaelthelin/spotify/TestConfiguration.java +++ b/src/test/java/se/michaelthelin/spotify/TestConfiguration.java @@ -2,6 +2,6 @@ public class TestConfiguration { - public static boolean USE_MOCK_RESPONSES = false; + public static boolean USE_MOCK_RESPONSES = true; } diff --git a/src/test/java/se/michaelthelin/spotify/methods/AlbumsRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/AlbumsRequestTest.java index 178e2a06c..132be82f9 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/AlbumsRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/AlbumsRequestTest.java @@ -20,6 +20,7 @@ import java.util.concurrent.TimeUnit; import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertNull; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; @@ -80,8 +81,11 @@ public void onFailure(Throwable throwable) { public void shouldGetAlbumResultForIds_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("albums.json"); - final AlbumsRequest request = api.getAlbums("41MnTivkwTO3UUJ8DrqEJJ").httpManager(mockedHttpManager).build(); + final AlbumsRequest.Builder requestBuilder = api.getAlbums("41MnTivkwTO3UUJ8DrqEJJ"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("albums.json")); + } + final AlbumsRequest request = requestBuilder.build(); List albums = request.get(); @@ -89,6 +93,22 @@ public void shouldGetAlbumResultForIds_sync() throws Exception { Album firstAlbum = albums.get(0); assertEquals("41MnTivkwTO3UUJ8DrqEJJ", firstAlbum.getId()); + assertEquals(AlbumType.ALBUM, firstAlbum.getAlbumType()); + assertTrue(firstAlbum.getReleaseDate().getDate().equals(8)); + assertTrue(firstAlbum.getReleaseDate().getMonth().equals(11)); + assertEquals(2013, firstAlbum.getReleaseDate().getYear()); + + List artists = firstAlbum.getArtists(); + SimpleArtist firstArtist = artists.get(0); + assertEquals("https://api.spotify.com/v1/artists/53A0W3U0s8diEn9RhXQhVz", firstArtist.getHref()); + assertEquals("53A0W3U0s8diEn9RhXQhVz", firstArtist.getId()); + + Page tracksPage = firstAlbum.getTracks(); + assertEquals("https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=0&limit=50", tracksPage.getHref()); + assertEquals(0, tracksPage.getOffset()); + assertEquals(50, tracksPage.getLimit()); + assertEquals(38, tracksPage.getTotal()); + assertEquals("4r9PmSmbAOOWqaGWLf6M9Q", tracksPage.getItems().get(0).getId()); } @Test @@ -96,7 +116,11 @@ public void shouldFailForBadField_async() throws Exception { final Api api = Api.DEFAULT_API; final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("error_bad-field.json"); - final AlbumsRequest request = api.getAlbums("41MnTivkwTO3UUJ8DrqEJJ").httpManager(mockedHttpManager).build(); + final AlbumsRequest.Builder requestBuilder = api.getAlbums("41MnTivkwTO3UUJ8DrqEJJ,你好"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(mockedHttpManager).build(); + } + final AlbumsRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -123,8 +147,11 @@ public void onFailure(Throwable throwable) { public void shouldFailForNotFound_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("error_id-not-found.json"); - final AlbumsRequest request = api.getAlbums("41MnTivkwTO3UUJ8DrqEJJ").httpManager(mockedHttpManager).build(); + final AlbumsRequest.Builder requestBuilder = api.getAlbums("idontexist"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("albums-none-found.json")); + } + final AlbumsRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -132,14 +159,15 @@ public void shouldFailForNotFound_async() throws Exception { Futures.addCallback(albumFuture, new FutureCallback>() { @Override - public void onSuccess(List album) { - fail(); + public void onSuccess(List albums) { + assertEquals(1, albums.size()); + assertNull(albums.get(0)); + asyncCompleted.countDown(); } @Override public void onFailure(Throwable throwable) { - TestCase.assertEquals(throwable.getClass(), NotFoundException.class); - asyncCompleted.countDown(); + fail(); } }); From 3e0fa95ab146f3c4142ab21168b4d9e1e9dd9cc6 Mon Sep 17 00:00:00 2001 From: Michael Thelin Date: Sat, 17 May 2014 00:11:43 +0200 Subject: [PATCH 08/10] Can run artistrequests tests against live instead of mock --- .../spotify/methods/ArtistRequestTest.java | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/test/java/se/michaelthelin/spotify/methods/ArtistRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/ArtistRequestTest.java index 6024fb18e..ef57411e6 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/ArtistRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/ArtistRequestTest.java @@ -7,7 +7,7 @@ import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; -import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.models.Artist; @@ -24,8 +24,11 @@ public class ArtistRequestTest { public void shouldGetArtistResult_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("artist.json"); - final ArtistRequest request = api.getArtist("0LcJLqbBmaGUft1e9Mm8HV").httpManager(mockedHttpManager).build(); + ArtistRequest.Builder requestBuilder = api.getArtist("0LcJLqbBmaGUft1e9Mm8HV"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("artist.json")); + } + ArtistRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -35,7 +38,14 @@ public void shouldGetArtistResult_async() throws Exception { @Override public void onSuccess(Artist artist) { assertNotNull(artist); + assertEquals("https://open.spotify.com/artist/0LcJLqbBmaGUft1e9Mm8HV", artist.getExternalUrls().get("spotify")); + assertNotNull(artist.getGenres()); assertEquals("0LcJLqbBmaGUft1e9Mm8HV", artist.getId()); + assertNotNull(artist.getImages()); + assertEquals("ABBA", artist.getName()); + assertEquals(65, artist.getPopularity()); + assertEquals("spotify:artist:0LcJLqbBmaGUft1e9Mm8HV", artist.getUri()); + asyncCompleted.countDown(); } @@ -49,13 +59,22 @@ public void onFailure(Throwable throwable) { @Test public void shouldGetArtistResult_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("artist.json"); - final ArtistRequest request = api.getArtist("0LcJLqbBmaGUft1e9Mm8HV").httpManager(mockedHttpManager).build(); + ArtistRequest.Builder requestBuilder = api.getArtist("0LcJLqbBmaGUft1e9Mm8HV"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("artist.json")); + } + ArtistRequest request = requestBuilder.build(); final Artist artist = request.get(); assertNotNull(artist); + assertEquals("https://open.spotify.com/artist/0LcJLqbBmaGUft1e9Mm8HV", artist.getExternalUrls().get("spotify")); + assertNotNull(artist.getGenres()); assertEquals("0LcJLqbBmaGUft1e9Mm8HV", artist.getId()); + assertNotNull(artist.getImages()); + assertEquals("ABBA", artist.getName()); + assertEquals(65, artist.getPopularity()); + assertEquals("spotify:artist:0LcJLqbBmaGUft1e9Mm8HV", artist.getUri()); } } From 2239f5e4c21178c1ce40423868ec340e8171b7a3 Mon Sep 17 00:00:00 2001 From: Michael Thelin Date: Sat, 17 May 2014 00:17:32 +0200 Subject: [PATCH 09/10] Can run artist multiget request tests against live instead of mock --- .../spotify/methods/ArtistsRequestTest.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/test/java/se/michaelthelin/spotify/methods/ArtistsRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/ArtistsRequestTest.java index c34730d77..3043dcec0 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/ArtistsRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/ArtistsRequestTest.java @@ -8,6 +8,7 @@ import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.models.Artist; @@ -24,8 +25,12 @@ public class ArtistsRequestTest { @Test public void shouldGetArtistsResult_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("artists.json"); - final ArtistsRequest request = api.getArtists("0oSGxfWSnnOXhD2fKuz2Gy", "3dBVyJ7JuOMt4GE9607Qin").httpManager(mockedHttpManager).build(); + + final ArtistsRequest.Builder requestBuilder = api.getArtists("0oSGxfWSnnOXhD2fKuz2Gy", "3dBVyJ7JuOMt4GE9607Qin"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("artists.json")); + } + final ArtistsRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -36,8 +41,8 @@ public void shouldGetArtistsResult_async() throws Exception { public void onSuccess(List artists) { assertEquals(2, artists.size()); - Artist firstArtist = artists.get(0); - Artist secondArtist = artists.get(1); + final Artist firstArtist = artists.get(0); + final Artist secondArtist = artists.get(1); assertEquals("0oSGxfWSnnOXhD2fKuz2Gy", firstArtist.getId()); assertEquals("3dBVyJ7JuOMt4GE9607Qin", secondArtist.getId()); @@ -57,8 +62,12 @@ public void onFailure(Throwable throwable) { @Test public void shouldGetArtistsResult_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("artists.json"); - final ArtistsRequest request = api.getArtists("0oSGxfWSnnOXhD2fKuz2Gy", "3dBVyJ7JuOMt4GE9607Qin").httpManager(mockedHttpManager).build(); + + final ArtistsRequest.Builder requestBuilder = api.getArtists("0oSGxfWSnnOXhD2fKuz2Gy", "3dBVyJ7JuOMt4GE9607Qin"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("artists.json")); + } + final ArtistsRequest request = requestBuilder.build(); final List artists = request.get(); From 24b8f5f4fdb835822a6c0f6e0def746905384fb2 Mon Sep 17 00:00:00 2001 From: Michael Thelin Date: Sun, 18 May 2014 20:19:43 +0200 Subject: [PATCH 10/10] Can run all tests against production instead of mock --- .../spotify/methods/ArtistSearchRequest.java | 3 +- .../spotify/methods/TrackSearchRequest.java | 3 +- src/test/fixtures/search-track-page1.json | 656 ----- src/test/fixtures/search-track-page2.json | 2223 ----------------- src/test/fixtures/tracks-for-artist.json | 551 ++++ .../se/michaelthelin/spotify/ApiTest.java | 6 +- .../spotify/methods/ArtistRequestTest.java | 5 +- .../methods/ArtistSearchRequestTest.java | 56 +- .../spotify/methods/ArtistsRequestTest.java | 1 - .../spotify/methods/TopTracksRequestTest.java | 71 +- .../spotify/methods/TrackRequestTest.java | 18 +- .../methods/TrackSearchRequestTest.java | 41 +- .../spotify/methods/TracksRequestTest.java | 17 +- .../spotify/methods/UserRequestTest.java | 17 +- 14 files changed, 726 insertions(+), 2942 deletions(-) delete mode 100644 src/test/fixtures/search-track-page1.json delete mode 100644 src/test/fixtures/search-track-page2.json create mode 100644 src/test/fixtures/tracks-for-artist.json diff --git a/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java b/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java index 8f38e3c56..2011ca4c2 100644 --- a/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java +++ b/src/main/java/se/michaelthelin/spotify/methods/ArtistSearchRequest.java @@ -45,9 +45,8 @@ public static final class Builder extends AbstractRequest.Builder { public Builder query(String query) { assert (query != null); path("/v1/search"); - String massagedQuery = query.replace(" ", "+"); parameter("type","artist"); - return parameter("q", massagedQuery); + return parameter("q", query); } public Builder limit(int limit) { diff --git a/src/main/java/se/michaelthelin/spotify/methods/TrackSearchRequest.java b/src/main/java/se/michaelthelin/spotify/methods/TrackSearchRequest.java index 01455c97e..74f090019 100644 --- a/src/main/java/se/michaelthelin/spotify/methods/TrackSearchRequest.java +++ b/src/main/java/se/michaelthelin/spotify/methods/TrackSearchRequest.java @@ -44,9 +44,8 @@ public static final class Builder extends AbstractRequest.Builder { public Builder query(String query) { assert (query != null); path("/v1/search"); - String massagedQuery = query.replace(" ", "+"); parameter("type","track"); - return parameter("q", massagedQuery); + return parameter("q", query); } public Builder limit(int limit) { diff --git a/src/test/fixtures/search-track-page1.json b/src/test/fixtures/search-track-page1.json deleted file mode 100644 index 36c407ec4..000000000 --- a/src/test/fixtures/search-track-page1.json +++ /dev/null @@ -1,656 +0,0 @@ -{ - "tracks" : { - "href" : "https://api.spotify.com/v1/search?query=tania+bowra&offset=0&limit=20&type=track", - "items" : [ { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 276773, - "explicit" : false, - "external_ids" : { - "isrc" : "AUCR10410001" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/2TpxZ7JUBn3uw46aR7qd6V" - }, - "href" : "https://api.spotify.com/v1/tracks/2TpxZ7JUBn3uw46aR7qd6V", - "id" : "2TpxZ7JUBn3uw46aR7qd6V", - "name" : "All I Want", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/6d00206e32194d15df329d4770e4fa1f2ced3f57", - "track_number" : 1, - "type" : "track", - "uri" : "spotify:track:2TpxZ7JUBn3uw46aR7qd6V" - }, { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 247680, - "explicit" : false, - "external_ids" : { - "isrc" : "AUCR10410002" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/4PjcfyZZVE10TFd9EKA72r" - }, - "href" : "https://api.spotify.com/v1/tracks/4PjcfyZZVE10TFd9EKA72r", - "id" : "4PjcfyZZVE10TFd9EKA72r", - "name" : "Someday", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/2b15de922bf4f4b8cfe09c8448079b8ff7a45a5f", - "track_number" : 2, - "type" : "track", - "uri" : "spotify:track:4PjcfyZZVE10TFd9EKA72r" - }, { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 204093, - "explicit" : false, - "external_ids" : { - "isrc" : "AUCR10410003" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/2tniUNfN0hmqavFuJ2NodO" - }, - "href" : "https://api.spotify.com/v1/tracks/2tniUNfN0hmqavFuJ2NodO", - "id" : "2tniUNfN0hmqavFuJ2NodO", - "name" : "Wet Wood", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/330aa73c34f81c164f00f7cf4e3de1368e59ff20", - "track_number" : 3, - "type" : "track", - "uri" : "spotify:track:2tniUNfN0hmqavFuJ2NodO" - }, { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 240253, - "explicit" : false, - "external_ids" : { - "isrc" : "AUCR10410004" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/1irrhbi54Uwsrky0s3SrPz" - }, - "href" : "https://api.spotify.com/v1/tracks/1irrhbi54Uwsrky0s3SrPz", - "id" : "1irrhbi54Uwsrky0s3SrPz", - "name" : "Give It 2 Me", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/2f0bd7efcd2addda3330990366b81df3fdc37c8c", - "track_number" : 4, - "type" : "track", - "uri" : "spotify:track:1irrhbi54Uwsrky0s3SrPz" - }, { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 220173, - "explicit" : false, - "external_ids" : { - "isrc" : "AUCR10410005" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/4JAJ6ujlF593H31kA4UhjR" - }, - "href" : "https://api.spotify.com/v1/tracks/4JAJ6ujlF593H31kA4UhjR", - "id" : "4JAJ6ujlF593H31kA4UhjR", - "name" : "Be Mine", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/271590224d1b24af07b777ffc744191cda49c9b4", - "track_number" : 5, - "type" : "track", - "uri" : "spotify:track:4JAJ6ujlF593H31kA4UhjR" - }, { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 281946, - "explicit" : false, - "external_ids" : { - "isrc" : "AUCR10410006" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/6UbiYwgZJrwqB5ILDVk1e5" - }, - "href" : "https://api.spotify.com/v1/tracks/6UbiYwgZJrwqB5ILDVk1e5", - "id" : "6UbiYwgZJrwqB5ILDVk1e5", - "name" : "Desire", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/22ae385689d8ac4f3919ad26057edf215a70e912", - "track_number" : 6, - "type" : "track", - "uri" : "spotify:track:6UbiYwgZJrwqB5ILDVk1e5" - }, { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 189240, - "explicit" : false, - "external_ids" : { - "isrc" : "AUCR10410007" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/0WIfmQdGqTbZQjjoSxM8hB" - }, - "href" : "https://api.spotify.com/v1/tracks/0WIfmQdGqTbZQjjoSxM8hB", - "id" : "0WIfmQdGqTbZQjjoSxM8hB", - "name" : "Eastside", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/46b2b6e73675680a136a640fad9b96adb4db37ae", - "track_number" : 7, - "type" : "track", - "uri" : "spotify:track:0WIfmQdGqTbZQjjoSxM8hB" - }, { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 230440, - "explicit" : false, - "external_ids" : { - "isrc" : "AUCR10410008" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/1Xan3mf1E173v2n4wbQFeO" - }, - "href" : "https://api.spotify.com/v1/tracks/1Xan3mf1E173v2n4wbQFeO", - "id" : "1Xan3mf1E173v2n4wbQFeO", - "name" : "Easy Way", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/1926686f64b709f529d94b8af39398a7d5551fc8", - "track_number" : 8, - "type" : "track", - "uri" : "spotify:track:1Xan3mf1E173v2n4wbQFeO" - }, { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 281320, - "explicit" : false, - "external_ids" : { - "isrc" : "AUCR10410009" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/5cBLGuA6AFlZISzkRiE7IT" - }, - "href" : "https://api.spotify.com/v1/tracks/5cBLGuA6AFlZISzkRiE7IT", - "id" : "5cBLGuA6AFlZISzkRiE7IT", - "name" : "Sympathy", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/b55ab54cf457eb8a178fefbbbf32c52f64be9d5d", - "track_number" : 9, - "type" : "track", - "uri" : "spotify:track:5cBLGuA6AFlZISzkRiE7IT" - }, { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 262400, - "explicit" : false, - "external_ids" : { - "isrc" : "AUCR10410010" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/3Wlw9nfntmKxVxLMzZeYLB" - }, - "href" : "https://api.spotify.com/v1/tracks/3Wlw9nfntmKxVxLMzZeYLB", - "id" : "3Wlw9nfntmKxVxLMzZeYLB", - "name" : "Pleasure And Pain", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/df9af685d4481ca17218b351263562f4b774adea", - "track_number" : 10, - "type" : "track", - "uri" : "spotify:track:3Wlw9nfntmKxVxLMzZeYLB" - }, { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/6akEvsycLGftJxYudPjmqK" - }, - "href" : "https://api.spotify.com/v1/albums/6akEvsycLGftJxYudPjmqK", - "id" : "6akEvsycLGftJxYudPjmqK", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4", - "width" : 64 - } ], - "name" : "Place In The Sun", - "type" : "album", - "uri" : "spotify:album:6akEvsycLGftJxYudPjmqK" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 240973, - "explicit" : false, - "external_ids" : { - "isrc" : "AUCR10410011" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/6DonRyqagGQGdbjMKRy5f7" - }, - "href" : "https://api.spotify.com/v1/tracks/6DonRyqagGQGdbjMKRy5f7", - "id" : "6DonRyqagGQGdbjMKRy5f7", - "name" : "Peace Like A Summer Breeze", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/77823e8af90501f950c324eb96ac600af8004a36", - "track_number" : 11, - "type" : "track", - "uri" : "spotify:track:6DonRyqagGQGdbjMKRy5f7" - }, { - "album" : { - "album_type" : "album", - "external_urls" : { - "spotify" : "https://open.spotify.com/album/1FrhRifX9s3sjpkoYG9N81" - }, - "href" : "https://api.spotify.com/v1/albums/1FrhRifX9s3sjpkoYG9N81", - "id" : "1FrhRifX9s3sjpkoYG9N81", - "images" : [ { - "height" : 640, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/5382502ee28643a22e9082cb680eafde0e45fde8", - "width" : 640 - }, { - "height" : 300, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/407efbd7bb47d6631c8336f8a9f22c6430166d7b", - "width" : 300 - }, { - "height" : 64, - "url" : "https://d3rt1990lpmkn.cloudfront.net/original/921622d03631fc53ad93bbd9edf0b11c1597ab41", - "width" : 64 - } ], - "name" : "The Reverent Jorfy", - "type" : "album", - "uri" : "spotify:album:1FrhRifX9s3sjpkoYG9N81" - }, - "artists" : [ { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/0aXuMYPvjBGthmsiknR0DY" - }, - "href" : "https://api.spotify.com/v1/artists/0aXuMYPvjBGthmsiknR0DY", - "id" : "0aXuMYPvjBGthmsiknR0DY", - "name" : "Andy Gordon", - "type" : "artist", - "uri" : "spotify:artist:0aXuMYPvjBGthmsiknR0DY" - }, { - "external_urls" : { - "spotify" : "https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q" - }, - "href" : "https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", - "id" : "08td7MxkoHQkXnWAYD8d6Q", - "name" : "Tania Bowra", - "type" : "artist", - "uri" : "spotify:artist:08td7MxkoHQkXnWAYD8d6Q" - } ], - "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], - "disc_number" : 1, - "duration_ms" : 282493, - "explicit" : false, - "external_ids" : { - "isrc" : "GBKPL1373490" - }, - "external_urls" : { - "spotify" : "https://open.spotify.com/track/2mlNUVIHh7zm66aMx3U2Nv" - }, - "href" : "https://api.spotify.com/v1/tracks/2mlNUVIHh7zm66aMx3U2Nv", - "id" : "2mlNUVIHh7zm66aMx3U2Nv", - "name" : "Waiting in Vain - Live", - "popularity" : 0, - "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/a49336c90d63698ee372242d11b66e64568458f8", - "track_number" : 3, - "type" : "track", - "uri" : "spotify:track:2mlNUVIHh7zm66aMx3U2Nv" - } ], - "limit" : 20, - "next" : null, - "offset" : 0, - "previous" : null, - "total" : 12 - } -} \ No newline at end of file diff --git a/src/test/fixtures/search-track-page2.json b/src/test/fixtures/search-track-page2.json deleted file mode 100644 index 60ba7bf71..000000000 --- a/src/test/fixtures/search-track-page2.json +++ /dev/null @@ -1,2223 +0,0 @@ -{ - "href": "https://api.spotify.com/v1/tracks/search?query=Brightside&offset=0&limit=20", - "items": [ - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/6TJmQnO44YE5BtTxH8pop1" - }, - "href": "https://api.spotify.com/v1/albums/6TJmQnO44YE5BtTxH8pop1", - "id": "6TJmQnO44YE5BtTxH8pop1", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/8e13218039f81b000553e25522a7f0d7a0600f2e", - "width": 629 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/8c1e066b5d1045038437d92815d49987f519e44f", - "width": 295 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/d49268a8fc0768084f4750cf1647709e89a27172", - "width": 63 - } - ], - "name": "Hot Fuss", - "type": "album", - "uri": "spotify:album:6TJmQnO44YE5BtTxH8pop1" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW", - "UY" - ], - "disc_number": 1, - "duration_ms": 222075, - "explicit": false, - "external_ids": { - "isrc": "USIR20400274" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/0eGsygTp906u18L0Oimnem" - }, - "href": "https://api.spotify.com/v1/tracks/0eGsygTp906u18L0Oimnem", - "id": "0eGsygTp906u18L0Oimnem", - "name": "Mr. Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/f454c8224828e21fa146af84916fd22cb89cedc6", - "track_number": 2, - "type": "track", - "uri": "spotify:track:0eGsygTp906u18L0Oimnem" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/1m3pbwuYJS9OsXyM2jOSXE" - }, - "href": "https://api.spotify.com/v1/albums/1m3pbwuYJS9OsXyM2jOSXE", - "id": "1m3pbwuYJS9OsXyM2jOSXE", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/5a662b614397a7870a9289381219bca0210695a3", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/c3093c0c0cc69c8138e99e91cdec41f614d71eeb", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/cb409b9aa93c61327f59367be1fa961558f24f14", - "width": 64 - } - ], - "name": "Direct Hits", - "type": "album", - "uri": "spotify:album:1m3pbwuYJS9OsXyM2jOSXE" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW", - "UY" - ], - "disc_number": 1, - "duration_ms": 223973, - "explicit": false, - "external_ids": { - "isrc": "USIR20400274" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/5zvJ6DUahHHjeknQPn7iAH" - }, - "href": "https://api.spotify.com/v1/tracks/5zvJ6DUahHHjeknQPn7iAH", - "id": "5zvJ6DUahHHjeknQPn7iAH", - "name": "Mr. Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/0b32e8c0152a7ae231a3e3a3a8e51c31da577c5a", - "track_number": 1, - "type": "track", - "uri": "spotify:track:5zvJ6DUahHHjeknQPn7iAH" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/4A0K2Z4k7num90Qqi4ajk7" - }, - "href": "https://api.spotify.com/v1/albums/4A0K2Z4k7num90Qqi4ajk7", - "id": "4A0K2Z4k7num90Qqi4ajk7", - "images": [ - { - "height": 571, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/c375006ec2cfff23bdc520f73f9ad71e37a9a8e9", - "width": 640 - }, - { - "height": 268, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/e2229d955ccc46dc63948283a19ecd73b6d5e0e2", - "width": 300 - }, - { - "height": 57, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/025a37140ca7df06199178ae5f8069ce8069a845", - "width": 64 - } - ], - "name": "The Summer EP", - "type": "album", - "uri": "spotify:album:4A0K2Z4k7num90Qqi4ajk7" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/5pUmXBIQtqpvdV1HAy2xYC" - }, - "href": "https://api.spotify.com/v1/artists/5pUmXBIQtqpvdV1HAy2xYC", - "id": "5pUmXBIQtqpvdV1HAy2xYC", - "name": "Never Shout Never", - "type": "artist", - "uri": "spotify:artist:5pUmXBIQtqpvdV1HAy2xYC" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CA", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MX", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW", - "US", - "UY" - ], - "disc_number": 1, - "duration_ms": 125760, - "explicit": false, - "external_ids": { - "isrc": "USSCU0900008" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/4ydfntQQR5g5gkACYwXHHt" - }, - "href": "https://api.spotify.com/v1/tracks/4ydfntQQR5g5gkACYwXHHt", - "id": "4ydfntQQR5g5gkACYwXHHt", - "name": "On The Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/ba199abd994a93e2a8df50122ffec7ebe2071a25", - "track_number": 5, - "type": "track", - "uri": "spotify:track:4ydfntQQR5g5gkACYwXHHt" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/4jq3QW252vBI68ThF0pGsG" - }, - "href": "https://api.spotify.com/v1/albums/4jq3QW252vBI68ThF0pGsG", - "id": "4jq3QW252vBI68ThF0pGsG", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/756e06757b341524a6ab731ffb82239dbea726e1", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/b9f5f96f4cb8483d681ab9eb58414e7d16efd872", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/75aff74170b0c03372fbebd6ee4387a58b2cb765", - "width": 64 - } - ], - "name": "Acoustic Sessions: Vol. 3", - "type": "album", - "uri": "spotify:album:4jq3QW252vBI68ThF0pGsG" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/7CQwac16i1W5ej8YpuL3dv" - }, - "href": "https://api.spotify.com/v1/artists/7CQwac16i1W5ej8YpuL3dv", - "id": "7CQwac16i1W5ej8YpuL3dv", - "name": "Boyce Avenue", - "type": "artist", - "uri": "spotify:artist:7CQwac16i1W5ej8YpuL3dv" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CA", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MX", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW", - "US", - "UY" - ], - "disc_number": 1, - "duration_ms": 214634, - "explicit": false, - "external_ids": { - "isrc": "US-TCC-10-48908" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/4GDNloQXjSfiKu17AiUVy9" - }, - "href": "https://api.spotify.com/v1/tracks/4GDNloQXjSfiKu17AiUVy9", - "id": "4GDNloQXjSfiKu17AiUVy9", - "name": "Mr. Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/6472b0286cca1b73f7b625e3472c332f2af0bfd2", - "track_number": 9, - "type": "track", - "uri": "spotify:track:4GDNloQXjSfiKu17AiUVy9" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/1m3pbwuYJS9OsXyM2jOSXE" - }, - "href": "https://api.spotify.com/v1/albums/1m3pbwuYJS9OsXyM2jOSXE", - "id": "1m3pbwuYJS9OsXyM2jOSXE", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/5a662b614397a7870a9289381219bca0210695a3", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/c3093c0c0cc69c8138e99e91cdec41f614d71eeb", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/cb409b9aa93c61327f59367be1fa961558f24f14", - "width": 64 - } - ], - "name": "Direct Hits", - "type": "album", - "uri": "spotify:album:1m3pbwuYJS9OsXyM2jOSXE" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW", - "UY" - ], - "disc_number": 1, - "duration_ms": 262560, - "explicit": false, - "external_ids": { - "isrc": "USUM71312340" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/2zBr1gn08cg0XyEXFWlysq" - }, - "href": "https://api.spotify.com/v1/tracks/2zBr1gn08cg0XyEXFWlysq", - "id": "2zBr1gn08cg0XyEXFWlysq", - "name": "Mr. Brightside - Original Demo", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/f4603bef74b748cbf18c4ac8504876e988f4e441", - "track_number": 16, - "type": "track", - "uri": "spotify:track:2zBr1gn08cg0XyEXFWlysq" - }, - { - "album": { - "album_type": "single", - "external_urls": { - "spotify": "https://open.spotify.com/album/1x8d5zJ99au9eyfDWqf6ne" - }, - "href": "https://api.spotify.com/v1/albums/1x8d5zJ99au9eyfDWqf6ne", - "id": "1x8d5zJ99au9eyfDWqf6ne", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/56706ccb2a6a7c9a2dc7846885d0d529f8e61f7a", - "width": 638 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/34ec9340020fff67a975a621a6ab99de3e735074", - "width": 299 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/1660604501f235781933ba75f8cb7e5b2dabf435", - "width": 64 - } - ], - "name": "Mr. Brightside", - "type": "album", - "uri": "spotify:album:1x8d5zJ99au9eyfDWqf6ne" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AT", - "BE", - "CH", - "CR", - "CZ", - "DE", - "EE", - "FR", - "HU", - "IS", - "IT", - "LT", - "LV", - "PL", - "PT", - "RO", - "SE", - "SK", - "TR" - ], - "disc_number": 1, - "duration_ms": 527346, - "explicit": false, - "external_ids": { - "isrc": "USIR20500022" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/6JhKde0BZHaWRF6qjMlzzD" - }, - "href": "https://api.spotify.com/v1/tracks/6JhKde0BZHaWRF6qjMlzzD", - "id": "6JhKde0BZHaWRF6qjMlzzD", - "name": "Mr. Brightside - Jacques Lu Cont's Thin White Duke Mix", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/1b1c2baa9d99916cab723aba52271059ce168033", - "track_number": 3, - "type": "track", - "uri": "spotify:track:6JhKde0BZHaWRF6qjMlzzD" - }, - { - "album": { - "album_type": "single", - "external_urls": { - "spotify": "https://open.spotify.com/album/35gwWse8PdhWKfmymkBOLy" - }, - "href": "https://api.spotify.com/v1/albums/35gwWse8PdhWKfmymkBOLy", - "id": "35gwWse8PdhWKfmymkBOLy", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/56706ccb2a6a7c9a2dc7846885d0d529f8e61f7a", - "width": 638 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/34ec9340020fff67a975a621a6ab99de3e735074", - "width": 299 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/1660604501f235781933ba75f8cb7e5b2dabf435", - "width": 64 - } - ], - "name": "Mr. Brightside", - "type": "album", - "uri": "spotify:album:35gwWse8PdhWKfmymkBOLy" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AR", - "AT", - "BG", - "BO", - "BR", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LT", - "LV", - "MT", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW" - ], - "disc_number": 1, - "duration_ms": 223250, - "explicit": false, - "external_ids": { - "isrc": "USIR20400274" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/1odnNxp9EhAtZkeGifnve2" - }, - "href": "https://api.spotify.com/v1/tracks/1odnNxp9EhAtZkeGifnve2", - "id": "1odnNxp9EhAtZkeGifnve2", - "name": "Mr. Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/d42cee33e46952c46904861fe676f4a1b285a872", - "track_number": 1, - "type": "track", - "uri": "spotify:track:1odnNxp9EhAtZkeGifnve2" - }, - { - "album": { - "album_type": "single", - "external_urls": { - "spotify": "https://open.spotify.com/album/0UCXHS0TUIXCwf4c8Byz4A" - }, - "href": "https://api.spotify.com/v1/albums/0UCXHS0TUIXCwf4c8Byz4A", - "id": "0UCXHS0TUIXCwf4c8Byz4A", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/56706ccb2a6a7c9a2dc7846885d0d529f8e61f7a", - "width": 638 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/34ec9340020fff67a975a621a6ab99de3e735074", - "width": 299 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/1660604501f235781933ba75f8cb7e5b2dabf435", - "width": 64 - } - ], - "name": "Mr. Brightside", - "type": "album", - "uri": "spotify:album:0UCXHS0TUIXCwf4c8Byz4A" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AT", - "BE", - "CH", - "CZ", - "FR", - "IS", - "MY", - "NL", - "PL", - "PT", - "RO", - "SE", - "SK", - "TR" - ], - "disc_number": 1, - "duration_ms": 225093, - "explicit": false, - "external_ids": { - "isrc": "USIR20400750" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/6A1uEZn5eEuGgVmxMpem7X" - }, - "href": "https://api.spotify.com/v1/tracks/6A1uEZn5eEuGgVmxMpem7X", - "id": "6A1uEZn5eEuGgVmxMpem7X", - "name": "Mr. Brightside - CD Pro Version", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/a9461ce918d0e77a8bfd829da193c47d732e7118", - "track_number": 1, - "type": "track", - "uri": "spotify:track:6A1uEZn5eEuGgVmxMpem7X" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/10JoWJzLYBEYv8RSR5L0ow" - }, - "href": "https://api.spotify.com/v1/albums/10JoWJzLYBEYv8RSR5L0ow", - "id": "10JoWJzLYBEYv8RSR5L0ow", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/4869ed178df59df759eaaeb835800caa458d7fc4", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/2213461a89b88c6c2c41b12c1ab4cd3903d11adb", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/85c51847d7e4bcf22039300eed4126fe14f0f818", - "width": 64 - } - ], - "name": "Acoustic Sessions, Vol. 4", - "type": "album", - "uri": "spotify:album:10JoWJzLYBEYv8RSR5L0ow" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/7CQwac16i1W5ej8YpuL3dv" - }, - "href": "https://api.spotify.com/v1/artists/7CQwac16i1W5ej8YpuL3dv", - "id": "7CQwac16i1W5ej8YpuL3dv", - "name": "Boyce Avenue", - "type": "artist", - "uri": "spotify:artist:7CQwac16i1W5ej8YpuL3dv" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CA", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MX", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW", - "US", - "UY" - ], - "disc_number": 1, - "duration_ms": 214634, - "explicit": false, - "external_ids": { - "isrc": "US-TCF-10-18555" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/7it1rqEDgo7sKK5BZqe0qj" - }, - "href": "https://api.spotify.com/v1/tracks/7it1rqEDgo7sKK5BZqe0qj", - "id": "7it1rqEDgo7sKK5BZqe0qj", - "name": "Mr. Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/6472b0286cca1b73f7b625e3472c332f2af0bfd2", - "track_number": 5, - "type": "track", - "uri": "spotify:track:7it1rqEDgo7sKK5BZqe0qj" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/4wIUJ6kVdgsKdppNMYXKsF" - }, - "href": "https://api.spotify.com/v1/albums/4wIUJ6kVdgsKdppNMYXKsF", - "id": "4wIUJ6kVdgsKdppNMYXKsF", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/b896642dcb13763736bbe3caf64a3873645093bf", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/7077fc6e1871204e4c8a717e2fb37cd3c2b80780", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/18a37ccc0a4e2cc90fe7b1f0de5f5814a5ed9a3e", - "width": 64 - } - ], - "name": "Memory Lane (The Best Of McFly) [Deluxe Edition]", - "type": "album", - "uri": "spotify:album:4wIUJ6kVdgsKdppNMYXKsF" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/47izDDvtOxxz3FzHYuUptd" - }, - "href": "https://api.spotify.com/v1/artists/47izDDvtOxxz3FzHYuUptd", - "id": "47izDDvtOxxz3FzHYuUptd", - "name": "McFly", - "type": "artist", - "uri": "spotify:artist:47izDDvtOxxz3FzHYuUptd" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW", - "UY" - ], - "disc_number": 2, - "duration_ms": 217190, - "explicit": false, - "external_ids": { - "isrc": "GBAAN0500468" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/0YtcYTH9TkLbaUjSJUgbJ6" - }, - "href": "https://api.spotify.com/v1/tracks/0YtcYTH9TkLbaUjSJUgbJ6", - "id": "0YtcYTH9TkLbaUjSJUgbJ6", - "name": "Mr. Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/97b578ff5f09adabf2e6e2c123de749c9ba5bdd4", - "track_number": 17, - "type": "track", - "uri": "spotify:track:0YtcYTH9TkLbaUjSJUgbJ6" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/4OHNH3sDzIxnmUADXzv2kT" - }, - "href": "https://api.spotify.com/v1/albums/4OHNH3sDzIxnmUADXzv2kT", - "id": "4OHNH3sDzIxnmUADXzv2kT", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/8e13218039f81b000553e25522a7f0d7a0600f2e", - "width": 629 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/8c1e066b5d1045038437d92815d49987f519e44f", - "width": 295 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/d49268a8fc0768084f4750cf1647709e89a27172", - "width": 63 - } - ], - "name": "Hot Fuss (Deluxe Version)", - "type": "album", - "uri": "spotify:album:4OHNH3sDzIxnmUADXzv2kT" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW", - "UY" - ], - "disc_number": 1, - "duration_ms": 222200, - "explicit": false, - "external_ids": { - "isrc": "GBFFP0300052" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/3n3Ppam7vgaVa1iaRUc9Lp" - }, - "href": "https://api.spotify.com/v1/tracks/3n3Ppam7vgaVa1iaRUc9Lp", - "id": "3n3Ppam7vgaVa1iaRUc9Lp", - "name": "Mr. Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/95a5ea928c5493ca64a05d0daa0c0fa121694818", - "track_number": 2, - "type": "track", - "uri": "spotify:track:3n3Ppam7vgaVa1iaRUc9Lp" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/5QtJ3fjPxB8yFMVAjJ3mA5" - }, - "href": "https://api.spotify.com/v1/albums/5QtJ3fjPxB8yFMVAjJ3mA5", - "id": "5QtJ3fjPxB8yFMVAjJ3mA5", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/081565b1b42a1ffcc13349c208414ffc8b404581", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/22852d95057bc85ed9f769b49151c05ed9dfa359", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/d67367fc416f04b2f616b2da6a25e8843d9b024a", - "width": 64 - } - ], - "name": "Nu Rock", - "type": "album", - "uri": "spotify:album:5QtJ3fjPxB8yFMVAjJ3mA5" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MY", - "NI", - "NL", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW" - ], - "disc_number": 1, - "duration_ms": 223186, - "explicit": false, - "external_ids": { - "isrc": "USIR20400274" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/2UU6Pq9LaX1xWdrqUVoCW1" - }, - "href": "https://api.spotify.com/v1/tracks/2UU6Pq9LaX1xWdrqUVoCW1", - "id": "2UU6Pq9LaX1xWdrqUVoCW1", - "name": "Mr. Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/167745b42018b58d42810ebf32f50b3e8c715018", - "track_number": 1, - "type": "track", - "uri": "spotify:track:2UU6Pq9LaX1xWdrqUVoCW1" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/1zIUKU5nWTtfmlITcrFgyR" - }, - "href": "https://api.spotify.com/v1/albums/1zIUKU5nWTtfmlITcrFgyR", - "id": "1zIUKU5nWTtfmlITcrFgyR", - "images": [ - { - "height": 600, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/32211cefe17ed2db1eb416bec29929dfeaa29a53", - "width": 600 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/b4ddceb4e5d11e786146356e89426e8d82ee5c61", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/63d16c56716fe894bc76fd64bb98a15e6a537121", - "width": 64 - } - ], - "name": "Brightside", - "type": "album", - "uri": "spotify:album:1zIUKU5nWTtfmlITcrFgyR" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/2x7EATekOPhFGRx3syMGEC" - }, - "href": "https://api.spotify.com/v1/artists/2x7EATekOPhFGRx3syMGEC", - "id": "2x7EATekOPhFGRx3syMGEC", - "name": "The Knocks", - "type": "artist", - "uri": "spotify:artist:2x7EATekOPhFGRx3syMGEC" - } - ], - "available_markets": [ - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LT", - "LU", - "LV", - "MT", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW" - ], - "disc_number": 1, - "duration_ms": 269173, - "explicit": false, - "external_ids": { - "isrc": "USUM71115939" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/6805cAUNOsNgnOna7yu3sK" - }, - "href": "https://api.spotify.com/v1/tracks/6805cAUNOsNgnOna7yu3sK", - "id": "6805cAUNOsNgnOna7yu3sK", - "name": "Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/f0560cbfd95716cd67e58febb9348b43aa74d35b", - "track_number": 1, - "type": "track", - "uri": "spotify:track:6805cAUNOsNgnOna7yu3sK" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/5SYfYt6WXugR5ssTFWYAzZ" - }, - "href": "https://api.spotify.com/v1/albums/5SYfYt6WXugR5ssTFWYAzZ", - "id": "5SYfYt6WXugR5ssTFWYAzZ", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/d1875295e4770cf69181e4549abb45cfabfc80af", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/c7c28cb153edcdd9e1dfab9fdd56412bf4ca77bd", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/bf53f7ae35a20f27c23081e59999656c8b712e0d", - "width": 64 - } - ], - "name": "A Curious Thing (Exclusive Deluxe BP2)", - "type": "album", - "uri": "spotify:album:5SYfYt6WXugR5ssTFWYAzZ" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/1hJuGCUpefX24GFmss9bjH" - }, - "href": "https://api.spotify.com/v1/artists/1hJuGCUpefX24GFmss9bjH", - "id": "1hJuGCUpefX24GFmss9bjH", - "name": "Amy Macdonald", - "type": "artist", - "uri": "spotify:artist:1hJuGCUpefX24GFmss9bjH" - } - ], - "available_markets": [ - "AD", - "AR", - "BE", - "BO", - "BR", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MY", - "NI", - "NL", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW" - ], - "disc_number": 2, - "duration_ms": 252120, - "explicit": false, - "external_ids": { - "isrc": "GBUM71000896" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/49Vi3pAcWoq8bNectW8D9R" - }, - "href": "https://api.spotify.com/v1/tracks/49Vi3pAcWoq8bNectW8D9R", - "id": "49Vi3pAcWoq8bNectW8D9R", - "name": "Mr Brightside - Live At Barrowland Ballroom", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/53045b2743a0a2f96655377e5b0a018af75a0dca", - "track_number": 6, - "type": "track", - "uri": "spotify:track:49Vi3pAcWoq8bNectW8D9R" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/0Xa9TgVaUqQosIK3YcIWqL" - }, - "href": "https://api.spotify.com/v1/albums/0Xa9TgVaUqQosIK3YcIWqL", - "id": "0Xa9TgVaUqQosIK3YcIWqL", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/0b841b18b4e87f31c519b6e3fff309ac4ede0d78", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/183e4443912c7ad162fb14cbba62634460904679", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/cd8cfec88abaddc6abbef56f0b270f03d7e5209a", - "width": 64 - } - ], - "name": "Covers Album Vol. 03 (Three)", - "type": "album", - "uri": "spotify:album:0Xa9TgVaUqQosIK3YcIWqL" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/3CckGnXzzJ9GARII95dDek" - }, - "href": "https://api.spotify.com/v1/artists/3CckGnXzzJ9GARII95dDek", - "id": "3CckGnXzzJ9GARII95dDek", - "name": "ortoPilot", - "type": "artist", - "uri": "spotify:artist:3CckGnXzzJ9GARII95dDek" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CA", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MX", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW", - "US", - "UY" - ], - "disc_number": 1, - "duration_ms": 246642, - "explicit": false, - "external_ids": { - "isrc": "GBDMT0800871" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/7gIe8QpcfMKJJ5MSsCa472" - }, - "href": "https://api.spotify.com/v1/tracks/7gIe8QpcfMKJJ5MSsCa472", - "id": "7gIe8QpcfMKJJ5MSsCa472", - "name": "Mr Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/8cfba6457e5b1ac2ff0b77933878b2a3452f8568", - "track_number": 6, - "type": "track", - "uri": "spotify:track:7gIe8QpcfMKJJ5MSsCa472" - }, - { - "album": { - "album_type": "single", - "external_urls": { - "spotify": "https://open.spotify.com/album/1x8d5zJ99au9eyfDWqf6ne" - }, - "href": "https://api.spotify.com/v1/albums/1x8d5zJ99au9eyfDWqf6ne", - "id": "1x8d5zJ99au9eyfDWqf6ne", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/56706ccb2a6a7c9a2dc7846885d0d529f8e61f7a", - "width": 638 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/34ec9340020fff67a975a621a6ab99de3e735074", - "width": 299 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/1660604501f235781933ba75f8cb7e5b2dabf435", - "width": 64 - } - ], - "name": "Mr. Brightside", - "type": "album", - "uri": "spotify:album:1x8d5zJ99au9eyfDWqf6ne" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AT", - "BE", - "CH", - "CR", - "CZ", - "DE", - "EE", - "FR", - "HU", - "IS", - "IT", - "LT", - "LV", - "PL", - "PT", - "RO", - "SE", - "SK", - "TR" - ], - "disc_number": 1, - "duration_ms": 225093, - "explicit": false, - "external_ids": { - "isrc": "USIR20400750" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/6bLDDvzZUi4v4ORd35Gcgs" - }, - "href": "https://api.spotify.com/v1/tracks/6bLDDvzZUi4v4ORd35Gcgs", - "id": "6bLDDvzZUi4v4ORd35Gcgs", - "name": "Mr. Brightside - CD Pro Version", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/51b9c041f54ad4c3a14723dc4bc28711912b32b5", - "track_number": 1, - "type": "track", - "uri": "spotify:track:6bLDDvzZUi4v4ORd35Gcgs" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/1iVt0tBTAtI36FhmsxhuVd" - }, - "href": "https://api.spotify.com/v1/albums/1iVt0tBTAtI36FhmsxhuVd", - "id": "1iVt0tBTAtI36FhmsxhuVd", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/9a73a651f576e518b71bf2cb0bb0fb52ac64cf8f", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/a717f39245d19327daa1cc07d6cad8830291303c", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/795c6c4751623d33a0ef1da399f8a6d1d0c98128", - "width": 64 - } - ], - "name": "Covers Album Vol. 01 (One)", - "type": "album", - "uri": "spotify:album:1iVt0tBTAtI36FhmsxhuVd" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/3CckGnXzzJ9GARII95dDek" - }, - "href": "https://api.spotify.com/v1/artists/3CckGnXzzJ9GARII95dDek", - "id": "3CckGnXzzJ9GARII95dDek", - "name": "ortoPilot", - "type": "artist", - "uri": "spotify:artist:3CckGnXzzJ9GARII95dDek" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CA", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MX", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW", - "US", - "UY" - ], - "disc_number": 1, - "duration_ms": 250619, - "explicit": false, - "external_ids": { - "isrc": "GBDMT0800841" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/6iXt0dkyImkUVq8MB275p6" - }, - "href": "https://api.spotify.com/v1/tracks/6iXt0dkyImkUVq8MB275p6", - "id": "6iXt0dkyImkUVq8MB275p6", - "name": "Mr Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/67180ad97215663d7f2e4d1b0195af03e11a990d", - "track_number": 5, - "type": "track", - "uri": "spotify:track:6iXt0dkyImkUVq8MB275p6" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/68NlXKRuJ1YqrhIbwe864y" - }, - "href": "https://api.spotify.com/v1/albums/68NlXKRuJ1YqrhIbwe864y", - "id": "68NlXKRuJ1YqrhIbwe864y", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/7977a9a7851eab9db2eb22bdc064c93153077c42", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/f5ca8e7c7c335651aa1e04d99f218994a71b9bf2", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/22314e72bf196c285eff689140f36668cb1603c7", - "width": 64 - } - ], - "name": "Sawdust", - "type": "album", - "uri": "spotify:album:68NlXKRuJ1YqrhIbwe864y" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LV", - "MC", - "MT", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW" - ], - "disc_number": 1, - "duration_ms": 528026, - "explicit": false, - "external_ids": { - "isrc": "USIR20500022" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/2gt7oM6spRcAIzlfyt5Z9H" - }, - "href": "https://api.spotify.com/v1/tracks/2gt7oM6spRcAIzlfyt5Z9H", - "id": "2gt7oM6spRcAIzlfyt5Z9H", - "name": "Mr. Brightside - Jacques Lu Cont's Thin White Duke Mix", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/ac67dc847518713795b3cff856f31012c28fbce5", - "track_number": 17, - "type": "track", - "uri": "spotify:track:2gt7oM6spRcAIzlfyt5Z9H" - }, - { - "album": { - "album_type": "single", - "external_urls": { - "spotify": "https://open.spotify.com/album/35gwWse8PdhWKfmymkBOLy" - }, - "href": "https://api.spotify.com/v1/albums/35gwWse8PdhWKfmymkBOLy", - "id": "35gwWse8PdhWKfmymkBOLy", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/56706ccb2a6a7c9a2dc7846885d0d529f8e61f7a", - "width": 638 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/34ec9340020fff67a975a621a6ab99de3e735074", - "width": 299 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/1660604501f235781933ba75f8cb7e5b2dabf435", - "width": 64 - } - ], - "name": "Mr. Brightside", - "type": "album", - "uri": "spotify:album:35gwWse8PdhWKfmymkBOLy" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/0C0XlULifJtAgn6ZNCW2eu" - }, - "href": "https://api.spotify.com/v1/artists/0C0XlULifJtAgn6ZNCW2eu", - "id": "0C0XlULifJtAgn6ZNCW2eu", - "name": "The Killers", - "type": "artist", - "uri": "spotify:artist:0C0XlULifJtAgn6ZNCW2eu" - } - ], - "available_markets": [ - "AR", - "AT", - "BG", - "BO", - "BR", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LT", - "LV", - "MT", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW" - ], - "disc_number": 1, - "duration_ms": 278480, - "explicit": false, - "external_ids": { - "isrc": "USIR20500155" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/2asVOzUheYGJIG3jUj15Ni" - }, - "href": "https://api.spotify.com/v1/tracks/2asVOzUheYGJIG3jUj15Ni", - "id": "2asVOzUheYGJIG3jUj15Ni", - "name": "Mr. Brightside - RADIO - Jacques Lu Cont's Thin White Duke Mix", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/d05dbe937b0861cc4d7566cfefea07a1bd91fa42", - "track_number": 2, - "type": "track", - "uri": "spotify:track:2asVOzUheYGJIG3jUj15Ni" - }, - { - "album": { - "album_type": "album", - "external_urls": { - "spotify": "https://open.spotify.com/album/3Q6LxIPaD8Mn1L1bYjsSdA" - }, - "href": "https://api.spotify.com/v1/albums/3Q6LxIPaD8Mn1L1bYjsSdA", - "id": "3Q6LxIPaD8Mn1L1bYjsSdA", - "images": [ - { - "height": 640, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/98dc4680e30d9367d0ec606a863b517210c84134", - "width": 640 - }, - { - "height": 300, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/19b27f4ff8605018ba9612aef340db6eba613881", - "width": 300 - }, - { - "height": 64, - "url": "https://d3rt1990lpmkn.cloudfront.net/original/8e677546b285cc53267bc9dd5a94b1bda559ba76", - "width": 64 - } - ], - "name": "Welcome To Our Galaxee", - "type": "album", - "uri": "spotify:album:3Q6LxIPaD8Mn1L1bYjsSdA" - }, - "artists": [ - { - "external_urls": { - "spotify": "https://open.spotify.com/artist/4jpcMi4AYMiwLEBCDYTwkL" - }, - "href": "https://api.spotify.com/v1/artists/4jpcMi4AYMiwLEBCDYTwkL", - "id": "4jpcMi4AYMiwLEBCDYTwkL", - "name": "Galaxee", - "type": "artist", - "uri": "spotify:artist:4jpcMi4AYMiwLEBCDYTwkL" - } - ], - "available_markets": [ - "AD", - "AR", - "AT", - "AU", - "BE", - "BG", - "BO", - "BR", - "CA", - "CH", - "CL", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "DO", - "EC", - "EE", - "ES", - "FI", - "FR", - "GB", - "GR", - "GT", - "HK", - "HN", - "HU", - "IE", - "IS", - "IT", - "LI", - "LT", - "LU", - "LV", - "MC", - "MT", - "MX", - "MY", - "NI", - "NL", - "NO", - "NZ", - "PA", - "PE", - "PH", - "PL", - "PT", - "PY", - "RO", - "SE", - "SG", - "SI", - "SK", - "SV", - "TR", - "TW", - "US", - "UY" - ], - "disc_number": 1, - "duration_ms": 227920, - "explicit": false, - "external_ids": { - "isrc": "NONOR0201140" - }, - "external_urls": { - "spotify": "https://open.spotify.com/track/19dotHoTeyQqRF9i3GcsxU" - }, - "href": "https://api.spotify.com/v1/tracks/19dotHoTeyQqRF9i3GcsxU", - "id": "19dotHoTeyQqRF9i3GcsxU", - "name": "Brightside", - "popularity": 0, - "preview_url": "http://d318706lgtcm8e.cloudfront.net/mp3-preview/e6ef9c72a05aa0994dad0e3d014e9347670b1f73", - "track_number": 14, - "type": "track", - "uri": "spotify:track:19dotHoTeyQqRF9i3GcsxU" - } - ], - "limit": 20, - "next": "https://api.spotify.com/v1/tracks/search?query=Brightside&offset=20&limit=20", - "offset": 0, - "previous": null, - "total": 714 -} \ No newline at end of file diff --git a/src/test/fixtures/tracks-for-artist.json b/src/test/fixtures/tracks-for-artist.json new file mode 100644 index 000000000..ff4ec4873 --- /dev/null +++ b/src/test/fixtures/tracks-for-artist.json @@ -0,0 +1,551 @@ +{ + "tracks" : [ { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/34EYk8vvJHCUlNrpGxepea" + }, + "href" : "https://api.spotify.com/v1/albums/34EYk8vvJHCUlNrpGxepea", + "id" : "34EYk8vvJHCUlNrpGxepea", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/6324fe377dcedf110025527873dafc9b7ee0bb34", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/d2e2148023e8a87b7a2f8d2abdfa936154e470b8", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/af45f7b48d8a4c7252e1b1ad9240ed8b08c06b31", + "width" : 64 + } ], + "name" : "Elvis 75 - Good Rockin' Tonight", + "type" : "album", + "uri" : "spotify:album:34EYk8vvJHCUlNrpGxepea" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/43ZHCT0cAZBISjO8DG9PnE" + }, + "href" : "https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE", + "id" : "43ZHCT0cAZBISjO8DG9PnE", + "name" : "Elvis Presley", + "type" : "artist", + "uri" : "spotify:artist:43ZHCT0cAZBISjO8DG9PnE" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 3, + "duration_ms" : 260973, + "explicit" : false, + "external_ids" : { + "isrc" : "USRC16901355" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/6fgjU6IfBOXHI3OKtndEeE" + }, + "href" : "https://api.spotify.com/v1/tracks/6fgjU6IfBOXHI3OKtndEeE", + "id" : "6fgjU6IfBOXHI3OKtndEeE", + "name" : "Suspicious Minds", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/3742af306537513a4f446d7c8f9cdb1cea6e36d1", + "track_number" : 19, + "type" : "track", + "uri" : "spotify:track:6fgjU6IfBOXHI3OKtndEeE" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/0QVoYzGd1p8Z3ohEaM0lsc" + }, + "href" : "https://api.spotify.com/v1/albums/0QVoYzGd1p8Z3ohEaM0lsc", + "id" : "0QVoYzGd1p8Z3ohEaM0lsc", + "images" : [ { + "height" : 636, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/4ab662302ae7e790b4dd7c381bc3a158852cd1e0", + "width" : 640 + }, { + "height" : 298, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/a024bb949556135ef3518f9ec320bb6544976ffe", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/1ed98a81960f1d3e7c959b8b786fdc2a5fb7c04a", + "width" : 64 + } ], + "name" : "Elvis 30 #1 Hits", + "type" : "album", + "uri" : "spotify:album:0QVoYzGd1p8Z3ohEaM0lsc" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/43ZHCT0cAZBISjO8DG9PnE" + }, + "href" : "https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE", + "id" : "43ZHCT0cAZBISjO8DG9PnE", + "name" : "Elvis Presley", + "type" : "artist", + "uri" : "spotify:artist:43ZHCT0cAZBISjO8DG9PnE" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 155333, + "explicit" : false, + "external_ids" : { + "isrc" : "USRC10200071" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/6pyex9B1kBoRIuabBAc4m8" + }, + "href" : "https://api.spotify.com/v1/tracks/6pyex9B1kBoRIuabBAc4m8", + "id" : "6pyex9B1kBoRIuabBAc4m8", + "name" : "Jailhouse Rock", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/fa7061f7112d69c2352ee904b5425f2d068153c6", + "track_number" : 8, + "type" : "track", + "uri" : "spotify:track:6pyex9B1kBoRIuabBAc4m8" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/34EYk8vvJHCUlNrpGxepea" + }, + "href" : "https://api.spotify.com/v1/albums/34EYk8vvJHCUlNrpGxepea", + "id" : "34EYk8vvJHCUlNrpGxepea", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/6324fe377dcedf110025527873dafc9b7ee0bb34", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/d2e2148023e8a87b7a2f8d2abdfa936154e470b8", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/af45f7b48d8a4c7252e1b1ad9240ed8b08c06b31", + "width" : 64 + } ], + "name" : "Elvis 75 - Good Rockin' Tonight", + "type" : "album", + "uri" : "spotify:album:34EYk8vvJHCUlNrpGxepea" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/43ZHCT0cAZBISjO8DG9PnE" + }, + "href" : "https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE", + "id" : "43ZHCT0cAZBISjO8DG9PnE", + "name" : "Elvis Presley", + "type" : "artist", + "uri" : "spotify:artist:43ZHCT0cAZBISjO8DG9PnE" + }, { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/6CXezToiGS8K6jr9kr8Muv" + }, + "href" : "https://api.spotify.com/v1/artists/6CXezToiGS8K6jr9kr8Muv", + "id" : "6CXezToiGS8K6jr9kr8Muv", + "name" : "The Jordanaires", + "type" : "artist", + "uri" : "spotify:artist:6CXezToiGS8K6jr9kr8Muv" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 2, + "duration_ms" : 182466, + "explicit" : false, + "external_ids" : { + "isrc" : "USRC16107318" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5l5oJ7rf3ZODYsrAS1hah4" + }, + "href" : "https://api.spotify.com/v1/tracks/5l5oJ7rf3ZODYsrAS1hah4", + "id" : "5l5oJ7rf3ZODYsrAS1hah4", + "name" : "Can't Help Falling in Love", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/fc4f2f55dec2e757c5c4898faa134eae07f5ebd6", + "track_number" : 22, + "type" : "track", + "uri" : "spotify:track:5l5oJ7rf3ZODYsrAS1hah4" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/0QVoYzGd1p8Z3ohEaM0lsc" + }, + "href" : "https://api.spotify.com/v1/albums/0QVoYzGd1p8Z3ohEaM0lsc", + "id" : "0QVoYzGd1p8Z3ohEaM0lsc", + "images" : [ { + "height" : 636, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/4ab662302ae7e790b4dd7c381bc3a158852cd1e0", + "width" : 640 + }, { + "height" : 298, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/a024bb949556135ef3518f9ec320bb6544976ffe", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/1ed98a81960f1d3e7c959b8b786fdc2a5fb7c04a", + "width" : 64 + } ], + "name" : "Elvis 30 #1 Hits", + "type" : "album", + "uri" : "spotify:album:0QVoYzGd1p8Z3ohEaM0lsc" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/43ZHCT0cAZBISjO8DG9PnE" + }, + "href" : "https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE", + "id" : "43ZHCT0cAZBISjO8DG9PnE", + "name" : "Elvis Presley", + "type" : "artist", + "uri" : "spotify:artist:43ZHCT0cAZBISjO8DG9PnE" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 177573, + "explicit" : false, + "external_ids" : { + "isrc" : "USRC10200079" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/6csLL0MBNVIMx19PfsKsW7" + }, + "href" : "https://api.spotify.com/v1/tracks/6csLL0MBNVIMx19PfsKsW7", + "id" : "6csLL0MBNVIMx19PfsKsW7", + "name" : "In the Ghetto", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/036675a7ddcd689963d0ed9ebeaaa28a6063b671", + "track_number" : 26, + "type" : "track", + "uri" : "spotify:track:6csLL0MBNVIMx19PfsKsW7" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/34EYk8vvJHCUlNrpGxepea" + }, + "href" : "https://api.spotify.com/v1/albums/34EYk8vvJHCUlNrpGxepea", + "id" : "34EYk8vvJHCUlNrpGxepea", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/6324fe377dcedf110025527873dafc9b7ee0bb34", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/d2e2148023e8a87b7a2f8d2abdfa936154e470b8", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/af45f7b48d8a4c7252e1b1ad9240ed8b08c06b31", + "width" : 64 + } ], + "name" : "Elvis 75 - Good Rockin' Tonight", + "type" : "album", + "uri" : "spotify:album:34EYk8vvJHCUlNrpGxepea" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/43ZHCT0cAZBISjO8DG9PnE" + }, + "href" : "https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE", + "id" : "43ZHCT0cAZBISjO8DG9PnE", + "name" : "Elvis Presley", + "type" : "artist", + "uri" : "spotify:artist:43ZHCT0cAZBISjO8DG9PnE" + }, { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/6EkPaTMpQmLwR7CgYiKHha" + }, + "href" : "https://api.spotify.com/v1/artists/6EkPaTMpQmLwR7CgYiKHha", + "id" : "6EkPaTMpQmLwR7CgYiKHha", + "name" : "JXL", + "type" : "artist", + "uri" : "spotify:artist:6EkPaTMpQmLwR7CgYiKHha" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 4, + "duration_ms" : 211173, + "explicit" : false, + "external_ids" : { + "isrc" : "USRC10200288" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/4l2hnfUx0esSbITQa7iJt0" + }, + "href" : "https://api.spotify.com/v1/tracks/4l2hnfUx0esSbITQa7iJt0", + "id" : "4l2hnfUx0esSbITQa7iJt0", + "name" : "A Little Less Conversation - JXL Radio Edit Remix", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/2704002b675f730a82b6ceb5f85df0e95149ffee", + "track_number" : 19, + "type" : "track", + "uri" : "spotify:track:4l2hnfUx0esSbITQa7iJt0" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/3X3rFfVKCW58sKMO0UXkwO" + }, + "href" : "https://api.spotify.com/v1/albums/3X3rFfVKCW58sKMO0UXkwO", + "id" : "3X3rFfVKCW58sKMO0UXkwO", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/98128f5c15aee1d481fb7722dbe71e8268ffbdcd", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/56d85a0391073513028a240ef39a0071a7aed419", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/9e9ef52f34dd8c51e1fc2d22c277200e4e1b12db", + "width" : 64 + } ], + "name" : "The Essential Elvis Presley", + "type" : "album", + "uri" : "spotify:album:3X3rFfVKCW58sKMO0UXkwO" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/43ZHCT0cAZBISjO8DG9PnE" + }, + "href" : "https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE", + "id" : "43ZHCT0cAZBISjO8DG9PnE", + "name" : "Elvis Presley", + "type" : "artist", + "uri" : "spotify:artist:43ZHCT0cAZBISjO8DG9PnE" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 2, + "duration_ms" : 217466, + "explicit" : false, + "external_ids" : { + "isrc" : "USRC10301082" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/0AmAZBnbXW7Dq1ykCamvRl" + }, + "href" : "https://api.spotify.com/v1/tracks/0AmAZBnbXW7Dq1ykCamvRl", + "id" : "0AmAZBnbXW7Dq1ykCamvRl", + "name" : "Always on My Mind - Remastered", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/93778849bcbeef71b7e0a4e3565cb48c60f583de", + "track_number" : 17, + "type" : "track", + "uri" : "spotify:track:0AmAZBnbXW7Dq1ykCamvRl" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/34EYk8vvJHCUlNrpGxepea" + }, + "href" : "https://api.spotify.com/v1/albums/34EYk8vvJHCUlNrpGxepea", + "id" : "34EYk8vvJHCUlNrpGxepea", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/6324fe377dcedf110025527873dafc9b7ee0bb34", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/d2e2148023e8a87b7a2f8d2abdfa936154e470b8", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/af45f7b48d8a4c7252e1b1ad9240ed8b08c06b31", + "width" : 64 + } ], + "name" : "Elvis 75 - Good Rockin' Tonight", + "type" : "album", + "uri" : "spotify:album:34EYk8vvJHCUlNrpGxepea" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/43ZHCT0cAZBISjO8DG9PnE" + }, + "href" : "https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE", + "id" : "43ZHCT0cAZBISjO8DG9PnE", + "name" : "Elvis Presley", + "type" : "artist", + "uri" : "spotify:artist:43ZHCT0cAZBISjO8DG9PnE" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 4, + "duration_ms" : 169680, + "explicit" : false, + "external_ids" : { + "isrc" : "USRC18705934" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/4VK3MDt1FAP101D0mnFJkz" + }, + "href" : "https://api.spotify.com/v1/tracks/4VK3MDt1FAP101D0mnFJkz", + "id" : "4VK3MDt1FAP101D0mnFJkz", + "name" : "Burning Love", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/90885646b987881e080faba8347a13dacd73fbdd", + "track_number" : 8, + "type" : "track", + "uri" : "spotify:track:4VK3MDt1FAP101D0mnFJkz" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/0QVoYzGd1p8Z3ohEaM0lsc" + }, + "href" : "https://api.spotify.com/v1/albums/0QVoYzGd1p8Z3ohEaM0lsc", + "id" : "0QVoYzGd1p8Z3ohEaM0lsc", + "images" : [ { + "height" : 636, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/4ab662302ae7e790b4dd7c381bc3a158852cd1e0", + "width" : 640 + }, { + "height" : 298, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/a024bb949556135ef3518f9ec320bb6544976ffe", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/1ed98a81960f1d3e7c959b8b786fdc2a5fb7c04a", + "width" : 64 + } ], + "name" : "Elvis 30 #1 Hits", + "type" : "album", + "uri" : "spotify:album:0QVoYzGd1p8Z3ohEaM0lsc" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/43ZHCT0cAZBISjO8DG9PnE" + }, + "href" : "https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE", + "id" : "43ZHCT0cAZBISjO8DG9PnE", + "name" : "Elvis Presley", + "type" : "artist", + "uri" : "spotify:artist:43ZHCT0cAZBISjO8DG9PnE" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 133293, + "explicit" : false, + "external_ids" : { + "isrc" : "USRC10200072" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/0JOw67rq2X6NDz5AJP9uIG" + }, + "href" : "https://api.spotify.com/v1/tracks/0JOw67rq2X6NDz5AJP9uIG", + "id" : "0JOw67rq2X6NDz5AJP9uIG", + "name" : "Hound Dog", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/04b7cd2ab6edf7648d37420b86de448f4a70e614", + "track_number" : 3, + "type" : "track", + "uri" : "spotify:track:0JOw67rq2X6NDz5AJP9uIG" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/0QVoYzGd1p8Z3ohEaM0lsc" + }, + "href" : "https://api.spotify.com/v1/albums/0QVoYzGd1p8Z3ohEaM0lsc", + "id" : "0QVoYzGd1p8Z3ohEaM0lsc", + "images" : [ { + "height" : 636, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/4ab662302ae7e790b4dd7c381bc3a158852cd1e0", + "width" : 640 + }, { + "height" : 298, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/a024bb949556135ef3518f9ec320bb6544976ffe", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/1ed98a81960f1d3e7c959b8b786fdc2a5fb7c04a", + "width" : 64 + } ], + "name" : "Elvis 30 #1 Hits", + "type" : "album", + "uri" : "spotify:album:0QVoYzGd1p8Z3ohEaM0lsc" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/43ZHCT0cAZBISjO8DG9PnE" + }, + "href" : "https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE", + "id" : "43ZHCT0cAZBISjO8DG9PnE", + "name" : "Elvis Presley", + "type" : "artist", + "uri" : "spotify:artist:43ZHCT0cAZBISjO8DG9PnE" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 140426, + "explicit" : false, + "external_ids" : { + "isrc" : "USRC10200345" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/0D1pEisM3QkiacGXJe5dmd" + }, + "href" : "https://api.spotify.com/v1/tracks/0D1pEisM3QkiacGXJe5dmd", + "id" : "0D1pEisM3QkiacGXJe5dmd", + "name" : "(You're The) Devil in Disguise", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/ce5a9ebe970ca3d544dedecd14cc4f869aebf032", + "track_number" : 24, + "type" : "track", + "uri" : "spotify:track:0D1pEisM3QkiacGXJe5dmd" + }, { + "album" : { + "album_type" : "album", + "external_urls" : { + "spotify" : "https://open.spotify.com/album/34EYk8vvJHCUlNrpGxepea" + }, + "href" : "https://api.spotify.com/v1/albums/34EYk8vvJHCUlNrpGxepea", + "id" : "34EYk8vvJHCUlNrpGxepea", + "images" : [ { + "height" : 640, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/6324fe377dcedf110025527873dafc9b7ee0bb34", + "width" : 640 + }, { + "height" : 300, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/d2e2148023e8a87b7a2f8d2abdfa936154e470b8", + "width" : 300 + }, { + "height" : 64, + "url" : "https://d3rt1990lpmkn.cloudfront.net/original/af45f7b48d8a4c7252e1b1ad9240ed8b08c06b31", + "width" : 64 + } ], + "name" : "Elvis 75 - Good Rockin' Tonight", + "type" : "album", + "uri" : "spotify:album:34EYk8vvJHCUlNrpGxepea" + }, + "artists" : [ { + "external_urls" : { + "spotify" : "https://open.spotify.com/artist/43ZHCT0cAZBISjO8DG9PnE" + }, + "href" : "https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE", + "id" : "43ZHCT0cAZBISjO8DG9PnE", + "name" : "Elvis Presley", + "type" : "artist", + "uri" : "spotify:artist:43ZHCT0cAZBISjO8DG9PnE" + } ], + "available_markets" : [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ], + "disc_number" : 1, + "duration_ms" : 120440, + "explicit" : false, + "external_ids" : { + "isrc" : "USRC15602848" + }, + "external_urls" : { + "spotify" : "https://open.spotify.com/track/5wVttinuTqtg7PPWY9xO3T" + }, + "href" : "https://api.spotify.com/v1/tracks/5wVttinuTqtg7PPWY9xO3T", + "id" : "5wVttinuTqtg7PPWY9xO3T", + "name" : "Blue Suede Shoes", + "popularity" : 0, + "preview_url" : "http://d318706lgtcm8e.cloudfront.net/mp3-preview/95bd74ee17e968cd2689d54ecbcd038f502d2e81", + "track_number" : 11, + "type" : "track", + "uri" : "spotify:track:5wVttinuTqtg7PPWY9xO3T" + } ] +} \ No newline at end of file diff --git a/src/test/java/se/michaelthelin/spotify/ApiTest.java b/src/test/java/se/michaelthelin/spotify/ApiTest.java index c19703e88..3e0473326 100644 --- a/src/test/java/se/michaelthelin/spotify/ApiTest.java +++ b/src/test/java/se/michaelthelin/spotify/ApiTest.java @@ -137,7 +137,7 @@ public void shouldCreateSearchUrl() { Api api = Api.DEFAULT_API; Request request = api.searchTracks("moulat swalf").build(); assertEquals("https://api.spotify.com:443/v1/search", request.toString()); - assertHasParameter(request.toUrl(), "q", "moulat+swalf"); + assertHasParameter(request.toUrl(), "q", "moulat swalf"); assertHasParameter(request.toUrl(), "type", "track"); } @@ -164,7 +164,7 @@ public void shouldCreateSearchUrlWithLimitParameter() { Api api = Api.DEFAULT_API; Request request = api.searchTracks("moulat swalf").limit(2).build(); assertEquals("https://api.spotify.com:443/v1/search", request.toString()); - assertHasParameter(request.toUrl(), "q", "moulat+swalf"); + assertHasParameter(request.toUrl(), "q", "moulat swalf"); assertHasParameter(request.toUrl(), "limit", "2"); assertHasParameter(request.toUrl(), "type", "track"); } @@ -174,7 +174,7 @@ public void shouldCreateSearchUrlWithOffsetParameter() { Api api = Api.DEFAULT_API; Request request = api.searchTracks("moulat swalf").offset(2).build(); assertEquals("https://api.spotify.com:443/v1/search", request.toString()); - assertHasParameter(request.toUrl(), "q", "moulat+swalf"); + assertHasParameter(request.toUrl(), "q", "moulat swalf"); assertHasParameter(request.toUrl(), "offset", "2"); assertHasParameter(request.toUrl(), "type", "track"); } diff --git a/src/test/java/se/michaelthelin/spotify/methods/ArtistRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/ArtistRequestTest.java index ef57411e6..7037b64bb 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/ArtistRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/ArtistRequestTest.java @@ -15,6 +15,7 @@ import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; +import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; @RunWith(MockitoJUnitRunner.class) @@ -43,7 +44,7 @@ public void onSuccess(Artist artist) { assertEquals("0LcJLqbBmaGUft1e9Mm8HV", artist.getId()); assertNotNull(artist.getImages()); assertEquals("ABBA", artist.getName()); - assertEquals(65, artist.getPopularity()); + assertTrue(artist.getPopularity() >= 0 && artist.getPopularity() <= 100); assertEquals("spotify:artist:0LcJLqbBmaGUft1e9Mm8HV", artist.getUri()); asyncCompleted.countDown(); @@ -73,7 +74,7 @@ public void shouldGetArtistResult_sync() throws Exception { assertEquals("0LcJLqbBmaGUft1e9Mm8HV", artist.getId()); assertNotNull(artist.getImages()); assertEquals("ABBA", artist.getName()); - assertEquals(65, artist.getPopularity()); + assertTrue(artist.getPopularity() >= 0 && artist.getPopularity() <= 100); assertEquals("spotify:artist:0LcJLqbBmaGUft1e9Mm8HV", artist.getUri()); } diff --git a/src/test/java/se/michaelthelin/spotify/methods/ArtistSearchRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/ArtistSearchRequestTest.java index 8fb052d38..822583945 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/ArtistSearchRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/ArtistSearchRequestTest.java @@ -7,17 +7,18 @@ import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; -import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.models.Artist; import se.michaelthelin.spotify.models.Page; +import se.michaelthelin.spotify.models.SpotifyEntityType; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import static junit.framework.Assert.assertEquals; -import static junit.framework.TestCase.fail; +import static junit.framework.TestCase.*; @RunWith(MockitoJUnitRunner.class) public class ArtistSearchRequestTest { @@ -25,8 +26,12 @@ public class ArtistSearchRequestTest { @Test public void shouldGetArtistsResult_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-artist.json"); - final ArtistSearchRequest request = api.searchArtists("David Bowie").httpManager(mockedHttpManager).build(); + + final ArtistSearchRequest.Builder requestBuilder = api.searchArtists("tania bowra").limit(20).offset(0); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("search-artist.json")); + } + final ArtistSearchRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -35,11 +40,25 @@ public void shouldGetArtistsResult_async() throws Exception { Futures.addCallback(searchResultFuture, new FutureCallback>() { @Override public void onSuccess(Page artistSearchResult) { + assertEquals(20, artistSearchResult.getLimit()); + assertEquals(0, artistSearchResult.getOffset()); + assertTrue(artistSearchResult.getTotal() > 0); + assertEquals("null", artistSearchResult.getNext()); + assertEquals("null", artistSearchResult.getPrevious()); + assertEquals("https://api.spotify.com/v1/search?query=tania+bowra&offset=0&limit=20&type=artist", artistSearchResult.getHref()); + List artists = artistSearchResult.getItems(); - assertEquals(1, artists.size()); Artist firstArtist = artists.get(0); assertEquals("08td7MxkoHQkXnWAYD8d6Q", firstArtist.getId()); + assertEquals("https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q", firstArtist.getExternalUrls().get("spotify")); + assertNotNull(firstArtist.getGenres()); + assertEquals("https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", firstArtist.getHref()); + assertNotNull(firstArtist.getImages()); + assertEquals("Tania Bowra", firstArtist.getName()); + assertTrue(firstArtist.getPopularity() >= 0 && firstArtist.getPopularity() <= 100); + assertEquals(SpotifyEntityType.ARTIST, firstArtist.getType()); + assertEquals("spotify:artist:08td7MxkoHQkXnWAYD8d6Q", firstArtist.getUri()); asyncCompleted.countDown(); } @@ -56,17 +75,34 @@ public void onFailure(Throwable throwable) { @Test public void shouldGetArtistsResult_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-artist.json"); - final ArtistSearchRequest request = api.searchArtists("David Bowie").httpManager(mockedHttpManager).build(); + + final ArtistSearchRequest.Builder requestBuilder = api.searchArtists("tania bowra"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("search-artist.json")); + } + final ArtistSearchRequest request = requestBuilder.build(); final Page artistSearchResult = request.get(); - final List artists = artistSearchResult.getItems(); - assertEquals(1, artists.size()); + assertEquals(20, artistSearchResult.getLimit()); + assertEquals(0, artistSearchResult.getOffset()); + assertTrue(artistSearchResult.getTotal() > 0); + assertEquals("null", artistSearchResult.getNext()); + assertEquals("null", artistSearchResult.getPrevious()); + assertEquals("https://api.spotify.com/v1/search?query=tania+bowra&offset=0&limit=20&type=artist", artistSearchResult.getHref()); - final Artist firstArtist = artists.get(0); + List artists = artistSearchResult.getItems(); + Artist firstArtist = artists.get(0); assertEquals("08td7MxkoHQkXnWAYD8d6Q", firstArtist.getId()); + assertEquals("https://open.spotify.com/artist/08td7MxkoHQkXnWAYD8d6Q", firstArtist.getExternalUrls().get("spotify")); + assertNotNull(firstArtist.getGenres()); + assertEquals("https://api.spotify.com/v1/artists/08td7MxkoHQkXnWAYD8d6Q", firstArtist.getHref()); + assertNotNull(firstArtist.getImages()); + assertEquals("Tania Bowra", firstArtist.getName()); + assertTrue(firstArtist.getPopularity() >= 0 && firstArtist.getPopularity() <= 100); + assertEquals(SpotifyEntityType.ARTIST, firstArtist.getType()); + assertEquals("spotify:artist:08td7MxkoHQkXnWAYD8d6Q", firstArtist.getUri()); } } diff --git a/src/test/java/se/michaelthelin/spotify/methods/ArtistsRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/ArtistsRequestTest.java index 3043dcec0..ee4458715 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/ArtistsRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/ArtistsRequestTest.java @@ -7,7 +7,6 @@ import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; -import se.michaelthelin.spotify.HttpManager; import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.models.Artist; diff --git a/src/test/java/se/michaelthelin/spotify/methods/TopTracksRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/TopTracksRequestTest.java index 7593f3301..a315b10c2 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/TopTracksRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/TopTracksRequestTest.java @@ -7,8 +7,9 @@ import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; -import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; +import se.michaelthelin.spotify.models.SpotifyEntityType; import se.michaelthelin.spotify.models.Track; import java.util.List; @@ -16,7 +17,7 @@ import java.util.concurrent.TimeUnit; import static junit.framework.Assert.assertEquals; -import static junit.framework.TestCase.fail; +import static junit.framework.TestCase.*; @RunWith(MockitoJUnitRunner.class) public class TopTracksRequestTest { @@ -24,8 +25,12 @@ public class TopTracksRequestTest { @Test public void shouldGetTracksResult_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("tracks.json"); - final TopTracksRequest request = api.getTopTracksForArtist("43ZHCT0cAZBISjO8DG9PnE", "GB").httpManager(mockedHttpManager).build(); + + final TopTracksRequest.Builder requestBuilder = api.getTopTracksForArtist("43ZHCT0cAZBISjO8DG9PnE", "GB"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("tracks-for-artist.json")); + } + final TopTracksRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -34,13 +39,27 @@ public void shouldGetTracksResult_async() throws Exception { Futures.addCallback(tracksFuture, new FutureCallback>() { @Override public void onSuccess(List tracks) { - assertEquals(2, tracks.size()); + assertTrue(tracks.size() > 0); Track firstTrack = tracks.get(0); - assertEquals("0eGsygTp906u18L0Oimnem", firstTrack.getId()); - Track secondTrack = tracks.get(1); - assertEquals("1lDWb6b6ieDQ2xT7ewTC3G", secondTrack.getId()); + assertNotNull(firstTrack.getAlbum()); + assertNotNull(firstTrack.getArtists()); + assertNotNull(firstTrack.getAvailableMarkets()); + assertTrue(firstTrack.getDiscNumber() > 0); + assertTrue(firstTrack.getDuration() > 0); + assertNotNull(firstTrack.isExplicit()); + assertNotNull(firstTrack.getExternalIds()); + + String id = firstTrack.getId(); + assertNotNull(firstTrack.getId()); + assertEquals("https://open.spotify.com/track/" + id, firstTrack.getExternalUrls().get("spotify")); + assertEquals("https://api.spotify.com/v1/tracks/" + id, firstTrack.getHref()); + assertTrue(firstTrack.getPopularity() >= 0 && firstTrack.getPopularity() <= 100); + assertNotNull(firstTrack.getPreviewUrl()); + assertTrue(firstTrack.getTrackNumber() >= 0); + assertEquals(SpotifyEntityType.TRACK, firstTrack.getType()); + assertEquals("spotify:track:" + id, firstTrack.getUri()); asyncCompleted.countDown(); } @@ -57,18 +76,36 @@ public void onFailure(Throwable throwable) { @Test public void shouldGetTracksResult_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("tracks.json"); - final TopTracksRequest request = api.getTopTracksForArtist("43ZHCT0cAZBISjO8DG9PnE", "GB").httpManager(mockedHttpManager).build(); - - final List tracks = request.get(); - assertEquals(2, tracks.size()); + final TopTracksRequest.Builder requestBuilder = api.getTopTracksForArtist("43ZHCT0cAZBISjO8DG9PnE", "GB"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("tracks-for-artist.json")); + } + final TopTracksRequest request = requestBuilder.build(); - final Track firstTrack = tracks.get(0); - assertEquals("0eGsygTp906u18L0Oimnem", firstTrack.getId()); + final List tracks = request.get(); - final Track secondTrack = tracks.get(1); - assertEquals("1lDWb6b6ieDQ2xT7ewTC3G", secondTrack.getId()); + assertTrue(tracks.size() > 0); + + Track firstTrack = tracks.get(0); + + assertNotNull(firstTrack.getAlbum()); + assertNotNull(firstTrack.getArtists()); + assertNotNull(firstTrack.getAvailableMarkets()); + assertTrue(firstTrack.getDiscNumber() > 0); + assertTrue(firstTrack.getDuration() > 0); + assertNotNull(firstTrack.isExplicit()); + assertNotNull(firstTrack.getExternalIds()); + + String id = firstTrack.getId(); + assertNotNull(firstTrack.getId()); + assertEquals("https://open.spotify.com/track/" + id, firstTrack.getExternalUrls().get("spotify")); + assertEquals("https://api.spotify.com/v1/tracks/" + id, firstTrack.getHref()); + assertTrue(firstTrack.getPopularity() >= 0 && firstTrack.getPopularity() <= 100); + assertNotNull(firstTrack.getPreviewUrl()); + assertTrue(firstTrack.getTrackNumber() >= 0); + assertEquals(SpotifyEntityType.TRACK, firstTrack.getType()); + assertEquals("spotify:track:" + id, firstTrack.getUri()); } } diff --git a/src/test/java/se/michaelthelin/spotify/methods/TrackRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/TrackRequestTest.java index 901b7f1c3..55687918d 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/TrackRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/TrackRequestTest.java @@ -7,7 +7,7 @@ import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; -import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.models.Track; @@ -25,8 +25,12 @@ public class TrackRequestTest { @Test public void shouldGetTrackResult_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("track.json"); - final TrackRequest request = api.getTrack("0eGsygTp906u18L0Oimnem").httpManager(mockedHttpManager).build(); + + final TrackRequest.Builder requestBuilder = api.getTrack("0eGsygTp906u18L0Oimnem"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("track.json")); + } + final TrackRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -53,8 +57,12 @@ public void onFailure(Throwable throwable) { @Test public void shouldGetTrackResult_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("track.json"); - final TrackRequest request = api.getTrack("0eGsygTp906u18L0Oimnem").httpManager(mockedHttpManager).build(); + + final TrackRequest.Builder requestBuilder = api.getTrack("0eGsygTp906u18L0Oimnem"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("track.json")); + } + final TrackRequest request = requestBuilder.build(); final Track track = request.get(); diff --git a/src/test/java/se/michaelthelin/spotify/methods/TrackSearchRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/TrackSearchRequestTest.java index 29186439d..48b58c9ee 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/TrackSearchRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/TrackSearchRequestTest.java @@ -8,6 +8,7 @@ import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.models.Page; import se.michaelthelin.spotify.models.Track; @@ -17,7 +18,9 @@ import java.util.concurrent.TimeUnit; import static junit.framework.Assert.assertEquals; +import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; +import static org.junit.Assert.assertNotNull; @RunWith(MockitoJUnitRunner.class) public class TrackSearchRequestTest { @@ -25,8 +28,12 @@ public class TrackSearchRequestTest { @Test public void shouldGetTracksResult_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("search-track.json"); - final TrackSearchRequest request = api.searchTracks("Mr. Brightside").httpManager(mockedHttpManager).build(); + + final TrackSearchRequest.Builder requestBuilder = api.searchTracks("tania bowra").offset(0).limit(20); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("search-track.json")); + } + final TrackSearchRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -35,15 +42,19 @@ public void shouldGetTracksResult_async() throws Exception { Futures.addCallback(searchResultFuture, new FutureCallback>() { @Override public void onSuccess(Page trackSearchResult) { - List tracks = trackSearchResult.getItems(); + assertTrue(trackSearchResult.getTotal() > 0); + assertEquals(20, trackSearchResult.getLimit()); + assertEquals(0, trackSearchResult.getOffset()); - assertEquals(12, tracks.size()); + List tracks = trackSearchResult.getItems(); Track firstTrack = tracks.get(0); - assertEquals("2TpxZ7JUBn3uw46aR7qd6V", firstTrack.getId()); + assertNotNull(firstTrack.getId()); - Track secondTrack = tracks.get(1); - assertEquals("4PjcfyZZVE10TFd9EKA72r", secondTrack.getId()); + String id = firstTrack.getId(); + assertNotNull(firstTrack.getAlbum()); + assertNotNull(firstTrack.getArtists()); + assertEquals("https://api.spotify.com/v1/tracks/" + id, firstTrack.getHref()); asyncCompleted.countDown(); } @@ -65,15 +76,19 @@ public void shouldGetTracksResult_sync() throws Exception { final Page trackSearchResult = request.get(); - final List tracks = trackSearchResult.getItems(); + assertTrue(trackSearchResult.getTotal() > 0); + assertEquals(20, trackSearchResult.getLimit()); + assertEquals(0, trackSearchResult.getOffset()); - assertEquals(12, tracks.size()); + List tracks = trackSearchResult.getItems(); - final Track firstTrack = tracks.get(0); - assertEquals("2TpxZ7JUBn3uw46aR7qd6V", firstTrack.getId()); + Track firstTrack = tracks.get(0); + assertNotNull(firstTrack.getId()); - final Track secondTrack = tracks.get(1); - assertEquals("4PjcfyZZVE10TFd9EKA72r", secondTrack.getId()); + String id = firstTrack.getId(); + assertNotNull(firstTrack.getAlbum()); + assertNotNull(firstTrack.getArtists()); + assertEquals("https://api.spotify.com/v1/tracks/" + id, firstTrack.getHref()); } } diff --git a/src/test/java/se/michaelthelin/spotify/methods/TracksRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/TracksRequestTest.java index a7c97dc5f..172198b50 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/TracksRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/TracksRequestTest.java @@ -8,6 +8,7 @@ import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.models.Track; @@ -24,8 +25,12 @@ public class TracksRequestTest { @Test public void shouldGetTracksResult_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("tracks.json"); - final TracksRequest request = api.getTracks("0eGsygTp906u18L0Oimnem", "1lDWb6b6ieDQ2xT7ewTC3G").httpManager(mockedHttpManager).build(); + + final TracksRequest.Builder requestBuilder = api.getTracks("0eGsygTp906u18L0Oimnem", "1lDWb6b6ieDQ2xT7ewTC3G"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("tracks.json")); + } + final TracksRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -57,8 +62,12 @@ public void onFailure(Throwable throwable) { @Test public void shouldGetTracksResult_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("tracks.json"); - final TracksRequest request = api.getTracks("0eGsygTp906u18L0Oimnem", "1lDWb6b6ieDQ2xT7ewTC3G").httpManager(mockedHttpManager).build(); + + final TracksRequest.Builder requestBuilder = api.getTracks("0eGsygTp906u18L0Oimnem", "1lDWb6b6ieDQ2xT7ewTC3G"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("tracks.json")); + } + final TracksRequest request = requestBuilder.build(); final List tracks = request.get(); diff --git a/src/test/java/se/michaelthelin/spotify/methods/UserRequestTest.java b/src/test/java/se/michaelthelin/spotify/methods/UserRequestTest.java index 490439b04..82fc37cf7 100644 --- a/src/test/java/se/michaelthelin/spotify/methods/UserRequestTest.java +++ b/src/test/java/se/michaelthelin/spotify/methods/UserRequestTest.java @@ -8,6 +8,7 @@ import org.mockito.runners.MockitoJUnitRunner; import se.michaelthelin.spotify.Api; import se.michaelthelin.spotify.HttpManager; +import se.michaelthelin.spotify.TestConfiguration; import se.michaelthelin.spotify.TestUtil; import se.michaelthelin.spotify.models.User; @@ -25,8 +26,12 @@ public class UserRequestTest { @Test public void shouldCreateUser_async() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("user.json"); - final UserRequest request = api.getUser("wizzler").httpManager(mockedHttpManager).build(); + + final UserRequest.Builder requestBuilder = api.getUser("wizzler"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("user.json")); + } + final UserRequest request = requestBuilder.build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); @@ -53,8 +58,12 @@ public void onFailure(Throwable throwable) { @Test public void shouldCreateUser_sync() throws Exception { final Api api = Api.DEFAULT_API; - final HttpManager mockedHttpManager = TestUtil.MockedHttpManager.returningJson("user.json"); - final UserRequest request = api.getUser("wizzler").httpManager(mockedHttpManager).build(); + + final UserRequest.Builder requestBuilder = api.getUser("wizzler"); + if (TestConfiguration.USE_MOCK_RESPONSES) { + requestBuilder.httpManager(TestUtil.MockedHttpManager.returningJson("user.json")); + } + final UserRequest request = requestBuilder.build(); final User user = request.get(); assertNull(user.getEmail());