Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simplified JSON response wrappers and created base classes to a) allo…

…w uniform handling of last fm lists b) speed up introduction of new api methods
  • Loading branch information...
commit a850e620d01bed51d1b621fffa32efab05c36c57 1 parent 70ab02c
@michaellavelle authored
Showing with 292 additions and 184 deletions.
  1. +1 −0  src/main/java/org/springframework/social/lastfm/api/impl/LastFmErrorHandler.java
  2. +0 −1  src/main/java/org/springframework/social/lastfm/api/impl/LastFmTemplate.java
  3. +1 −1  src/main/java/org/springframework/social/lastfm/api/impl/TrackTemplate.java
  4. +10 −11 src/main/java/org/springframework/social/lastfm/api/impl/UserTemplate.java
  5. +15 −17 ...ework/social/lastfm/api/impl/json/{LastFmSingleTrackResponse.java → AbstractLastFmNestedResponse.java}
  6. +4 −13 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmFriendsResponse.java
  7. +5 −10 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmLovedTracksResponse.java
  8. +10 −1 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmModule.java
  9. +5 −11 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmNeighboursResponse.java
  10. +3 −9 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmProfileResponse.java
  11. +5 −10 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmRecentTracksResponse.java
  12. +4 −8 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmShoutsResponse.java
  13. +7 −9 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmSimpleTracksResponse.java
  14. +3 −9 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmTopTracksResponse.java
  15. +1 −0  src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmTrackMatchesResponse.java
  16. +4 −9 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmTrackSearchResponse.java
  17. +4 −10 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmTracksResponse.java
  18. +0 −3  src/main/java/org/springframework/social/lastfm/api/impl/json/ShoutMixin.java
  19. +51 −0 src/main/java/org/springframework/social/lastfm/api/impl/json/lists/AbstractLastFmListContainer.java
  20. +2 −4 src/main/java/org/springframework/social/lastfm/api/impl/json/{ → lists}/LastFmShoutListResponse.java
  21. +12 −6 ...va/org/springframework/social/lastfm/api/impl/json/{ → lists}/LastFmTrackSearchResultListResponse.java
  22. +2 −5 src/main/java/org/springframework/social/lastfm/api/impl/json/{ → lists}/LastFmUserListResponse.java
  23. +5 −13 src/main/java/org/springframework/social/lastfm/api/impl/json/{ → lists}/ShoutListContainer.java
  24. +69 −0 src/main/java/org/springframework/social/lastfm/api/impl/json/lists/SimpleTrackListContainer.java
  25. +5 −8 src/main/java/org/springframework/social/lastfm/api/impl/json/{ → lists}/TrackListContainer.java
  26. +54 −0 src/main/java/org/springframework/social/lastfm/api/impl/json/lists/TrackSearchResultListContainer.java
  27. +8 −16 src/main/java/org/springframework/social/lastfm/api/impl/json/{ → lists}/UserListContainer.java
  28. +2 −0  src/test/resources/org/springframework/social/lastfm/api/testdata/search-results.json
View
1  src/main/java/org/springframework/social/lastfm/api/impl/LastFmErrorHandler.java
@@ -153,6 +153,7 @@ private String readFully(InputStream in) throws IOException {
while (reader.ready()) {
sb.append(reader.readLine());
}
+ System.out.println(sb.toString());
return sb.toString();
}
View
1  src/main/java/org/springframework/social/lastfm/api/impl/LastFmTemplate.java
@@ -15,7 +15,6 @@
*/
package org.springframework.social.lastfm.api.impl;
-import java.text.SimpleDateFormat;
import java.util.List;
import org.codehaus.jackson.map.ObjectMapper;
View
2  src/main/java/org/springframework/social/lastfm/api/impl/TrackTemplate.java
@@ -40,7 +40,7 @@ public TrackTemplate(RestTemplate restTemplate,
return restTemplate
.getForObject(buildLastFmApiUrl(methodParameters),
LastFmTrackSearchResponse.class)
- .getTrackMatchesResponse().getTracksResponse().getTracks();
+ .getNestedResponse().getTracksResponse().getTracks();
}
}
View
21 src/main/java/org/springframework/social/lastfm/api/impl/UserTemplate.java
@@ -31,7 +31,6 @@
import org.springframework.social.lastfm.api.impl.json.LastFmNeighboursResponse;
import org.springframework.social.lastfm.api.impl.json.LastFmProfileResponse;
import org.springframework.social.lastfm.api.impl.json.LastFmRecentTracksResponse;
-import org.springframework.social.lastfm.api.impl.json.LastFmShoutListResponse;
import org.springframework.social.lastfm.api.impl.json.LastFmShoutsResponse;
import org.springframework.social.lastfm.api.impl.json.LastFmTopTracksResponse;
import org.springframework.social.lastfm.auth.LastFmAccessGrant;
@@ -59,7 +58,7 @@ public LastFmProfile getUserProfile() {
lastFmAccessGrant.getSessionKey());
return restTemplate.getForObject(buildLastFmApiUrl(methodParameters),
- LastFmProfileResponse.class).getLastFmProfile();
+ LastFmProfileResponse.class).getNestedResponse();
}
@@ -72,7 +71,7 @@ public LastFmProfile getUserProfile(String userName) {
"user.getInfo", apiKey, null, null, additionalParams);
return restTemplate.getForObject(buildLastFmApiUrl(methodParameters),
- LastFmProfileResponse.class).getLastFmProfile();
+ LastFmProfileResponse.class).getNestedResponse();
}
@@ -87,8 +86,8 @@ public LastFmProfile getUserProfile(String userName) {
return restTemplate
.getForObject(buildLastFmApiUrl(methodParameters),
- LastFmRecentTracksResponse.class).getTracksResponse()
- .getTracks();
+ LastFmRecentTracksResponse.class).getNestedResponse()
+ .getNestedResponse().getTracks();
}
@@ -103,7 +102,7 @@ public LastFmProfile getUserProfile(String userName) {
return restTemplate
.getForObject(buildLastFmApiUrl(methodParameters),
- LastFmLovedTracksResponse.class).getTracksResponse()
+ LastFmLovedTracksResponse.class).getNestedResponse().getNestedResponse()
.getTracks();
}
@@ -119,8 +118,8 @@ public LastFmProfile getUserProfile(String userName) {
return restTemplate
.getForObject(buildLastFmApiUrl(methodParameters),
- LastFmTopTracksResponse.class).getTracksResponse()
- .getTracks();
+ LastFmTopTracksResponse.class).getNestedResponse()
+ .getNestedResponse().getTracks();
}
@@ -185,7 +184,7 @@ public void shout(String userName, String message) {
return restTemplate
.getForObject(buildLastFmApiUrl(methodParameters),
- LastFmShoutsResponse.class).getShoutListResponse().getShouts();
+ LastFmShoutsResponse.class).getNestedResponse().getShouts();
}
@Override
@@ -198,7 +197,7 @@ public void shout(String userName, String message) {
return restTemplate
.getForObject(buildLastFmApiUrl(methodParameters),
- LastFmFriendsResponse.class).getUserListResponse().getUsers();
+ LastFmFriendsResponse.class).getNestedResponse().getUsers();
}
@Override
@@ -211,7 +210,7 @@ public void shout(String userName, String message) {
return restTemplate
.getForObject(buildLastFmApiUrl(methodParameters),
- LastFmNeighboursResponse.class).getUserListResponse().getUsers();
+ LastFmNeighboursResponse.class).getNestedResponse().getUsers();
}
}
View
32 ...stfm/api/impl/json/LastFmSingleTrackResponse.java → ...m/api/impl/json/AbstractLastFmNestedResponse.java
@@ -15,28 +15,26 @@
*/
package org.springframework.social.lastfm.api.impl.json;
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.lastfm.api.Track;
+import java.util.HashMap;
/**
* @author Michael Lavelle
*/
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmSingleTrackResponse {
-
- private List<Track> tracks;
+public abstract class AbstractLastFmNestedResponse<T> extends HashMap<String,T> {
- @JsonCreator
- public LastFmSingleTrackResponse(@JsonProperty("track") List<Track> tracks) {
- this.tracks = tracks;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private final String responseKey;
+
+ public AbstractLastFmNestedResponse(final String responseKey)
+ {
+ this.responseKey = responseKey;
}
-
- public List<Track> getTracks() {
- return tracks;
+
+ public T getNestedResponse() {
+ return get(responseKey);
}
-
}
View
17 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmFriendsResponse.java
@@ -15,26 +15,17 @@
*/
package org.springframework.social.lastfm.api.impl.json;
-import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
+import org.springframework.social.lastfm.api.impl.json.lists.LastFmUserListResponse;
/**
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmFriendsResponse {
+public class LastFmFriendsResponse extends AbstractLastFmNestedResponse<LastFmUserListResponse>{
- private LastFmUserListResponse userListResponse;
-
- @JsonCreator
- public LastFmFriendsResponse(
- @JsonProperty("friends") LastFmUserListResponse userListResponse) {
- this.userListResponse = userListResponse;
+ public LastFmFriendsResponse() {
+ super("friends");
}
-
- public LastFmUserListResponse getUserListResponse() {
- return userListResponse;
- }
}
View
15 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmLovedTracksResponse.java
@@ -23,17 +23,12 @@
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmLovedTracksResponse {
+public class LastFmLovedTracksResponse extends AbstractLastFmNestedResponse<LastFmTracksResponse>{
- private LastFmTracksResponse tracksResponse;
-
- @JsonCreator
- public LastFmLovedTracksResponse(
- @JsonProperty("lovedtracks") LastFmTracksResponse tracksResponse) {
- this.tracksResponse = tracksResponse;
+ public LastFmLovedTracksResponse() {
+ super("lovedtracks");
}
- public LastFmTracksResponse getTracksResponse() {
- return tracksResponse;
- }
+
+
}
View
11 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmModule.java
@@ -17,7 +17,6 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.Date;
import org.codehaus.jackson.Version;
import org.codehaus.jackson.map.module.SimpleModule;
@@ -29,6 +28,11 @@
import org.springframework.social.lastfm.api.SimpleTrack;
import org.springframework.social.lastfm.api.Track;
import org.springframework.social.lastfm.api.TrackSearchResult;
+import org.springframework.social.lastfm.api.impl.json.lists.ShoutListContainer;
+import org.springframework.social.lastfm.api.impl.json.lists.SimpleTrackListContainer;
+import org.springframework.social.lastfm.api.impl.json.lists.TrackListContainer;
+import org.springframework.social.lastfm.api.impl.json.lists.TrackSearchResultListContainer;
+import org.springframework.social.lastfm.api.impl.json.lists.UserListContainer;
/**
* Jackson module for setting up mixin annotations on LastFm model types. This
@@ -55,6 +59,11 @@ public void setupModule(SetupContext context) {
context.setMixInAnnotations(TrackListContainer.class, TrackMixin.class);
context.setMixInAnnotations(ShoutListContainer.class, ShoutMixin.class);
context.setMixInAnnotations(UserListContainer.class, LastFmProfileMixin.class);
+ context.setMixInAnnotations(TrackSearchResultListContainer.class, TrackSearchResultMixin.class);
+
+
+
+ context.setMixInAnnotations(SimpleTrackListContainer.class, SimpleTrackMixin.class);
context.setMixInAnnotations(Track.class, TrackMixin.class);
context.setMixInAnnotations(Shout.class, ShoutMixin.class);
View
16 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmNeighboursResponse.java
@@ -17,24 +17,18 @@
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
+import org.springframework.social.lastfm.api.impl.json.lists.LastFmUserListResponse;
/**
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmNeighboursResponse {
-
- private LastFmUserListResponse userListResponse;
+public class LastFmNeighboursResponse extends AbstractLastFmNestedResponse<LastFmUserListResponse>{
@JsonCreator
- public LastFmNeighboursResponse(
- @JsonProperty("neighbours") LastFmUserListResponse userListResponse) {
- this.userListResponse = userListResponse;
+ public LastFmNeighboursResponse() {
+ super("neighbours");
}
-
- public LastFmUserListResponse getUserListResponse() {
- return userListResponse;
- }
+
}
View
12 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmProfileResponse.java
@@ -24,19 +24,13 @@
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmProfileResponse {
+public class LastFmProfileResponse extends AbstractLastFmNestedResponse<LastFmProfile>{
- private LastFmProfile lastFmProfile;
@JsonCreator
- public LastFmProfileResponse(
- @JsonProperty("user") LastFmProfile lastFmProfile) {
- this.lastFmProfile = lastFmProfile;
-
+ public LastFmProfileResponse() {
+ super("user");
}
- public LastFmProfile getLastFmProfile() {
- return lastFmProfile;
- }
}
View
15 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmRecentTracksResponse.java
@@ -23,17 +23,12 @@
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmRecentTracksResponse {
-
- private LastFmSimpleTracksResponse tracksResponse;
+public class LastFmRecentTracksResponse extends AbstractLastFmNestedResponse<LastFmSimpleTracksResponse> {
@JsonCreator
- public LastFmRecentTracksResponse(
- @JsonProperty("recenttracks") LastFmSimpleTracksResponse tracksResponse) {
- this.tracksResponse = tracksResponse;
- }
-
- public LastFmSimpleTracksResponse getTracksResponse() {
- return tracksResponse;
+ public LastFmRecentTracksResponse()
+ {
+ super("recenttracks");
}
+
}
View
12 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmShoutsResponse.java
@@ -18,22 +18,18 @@
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
+import org.springframework.social.lastfm.api.impl.json.lists.LastFmShoutListResponse;
/**
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmShoutsResponse {
+public class LastFmShoutsResponse extends AbstractLastFmNestedResponse<LastFmShoutListResponse> {
- private LastFmShoutListResponse shoutListResponse;
@JsonCreator
- public LastFmShoutsResponse(
- @JsonProperty("shouts") LastFmShoutListResponse shoutListResponse) {
- this.shoutListResponse = shoutListResponse;
+ public LastFmShoutsResponse() {
+ super("shouts");
}
- public LastFmShoutListResponse getShoutListResponse() {
- return shoutListResponse;
- }
}
View
16 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmSimpleTracksResponse.java
@@ -15,29 +15,27 @@
*/
package org.springframework.social.lastfm.api.impl.json;
+import java.util.ArrayList;
import java.util.List;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
+import org.springframework.social.lastfm.api.LastFmProfile;
import org.springframework.social.lastfm.api.SimpleTrack;
+import org.springframework.social.lastfm.api.impl.json.lists.SimpleTrackListContainer;
/**
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmSimpleTracksResponse {
-
- private List<SimpleTrack> tracks;
+public class LastFmSimpleTracksResponse extends AbstractLastFmNestedResponse<SimpleTrackListContainer> {
@JsonCreator
- public LastFmSimpleTracksResponse(
- @JsonProperty("track") List<SimpleTrack> tracks) {
- this.tracks = tracks;
+ public LastFmSimpleTracksResponse() {
+ super("track");
}
- public List<SimpleTrack> getTracks() {
- return tracks;
- }
+
}
View
12 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmTopTracksResponse.java
@@ -23,17 +23,11 @@
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmTopTracksResponse {
-
- private LastFmTracksResponse tracksResponse;
+public class LastFmTopTracksResponse extends AbstractLastFmNestedResponse<LastFmTracksResponse> {
@JsonCreator
- public LastFmTopTracksResponse(
- @JsonProperty("toptracks") LastFmTracksResponse tracksResponse) {
- this.tracksResponse = tracksResponse;
+ public LastFmTopTracksResponse() {
+ super("toptracks");
}
- public LastFmTracksResponse getTracksResponse() {
- return tracksResponse;
- }
}
View
1  src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmTrackMatchesResponse.java
@@ -18,6 +18,7 @@
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
+import org.springframework.social.lastfm.api.impl.json.lists.LastFmTrackSearchResultListResponse;
/**
* @author Michael Lavelle
View
13 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmTrackSearchResponse.java
@@ -23,17 +23,12 @@
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmTrackSearchResponse {
-
- private LastFmTrackMatchesResponse tracksMatchesResponse;
+public class LastFmTrackSearchResponse extends AbstractLastFmNestedResponse<LastFmTrackMatchesResponse> {
@JsonCreator
- public LastFmTrackSearchResponse(
- @JsonProperty("results") LastFmTrackMatchesResponse tracksMatchesResponse) {
- this.tracksMatchesResponse = tracksMatchesResponse;
+ public LastFmTrackSearchResponse()
+ {
+ super("results");
}
- public LastFmTrackMatchesResponse getTrackMatchesResponse() {
- return tracksMatchesResponse;
- }
}
View
14 src/main/java/org/springframework/social/lastfm/api/impl/json/LastFmTracksResponse.java
@@ -21,23 +21,17 @@
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.springframework.social.lastfm.api.Track;
+import org.springframework.social.lastfm.api.impl.json.lists.TrackListContainer;
/**
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmTracksResponse {
-
- private List<Track> tracks;
+public class LastFmTracksResponse extends AbstractLastFmNestedResponse<TrackListContainer>{
@JsonCreator
- public LastFmTracksResponse(
- @JsonProperty("track") TrackListContainer tracksContainer) {
- this.tracks = tracksContainer.getTracks();
- }
-
- public List<Track> getTracks() {
- return tracks;
+ public LastFmTracksResponse() {
+ super("track");
}
}
View
3  src/main/java/org/springframework/social/lastfm/api/impl/json/ShoutMixin.java
@@ -20,9 +20,6 @@
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.map.annotate.JsonDeserialize;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-import org.springframework.social.lastfm.api.Artist;
/**
* Annotated mixin to add Jackson annotations to Shout.
View
51 src/main/java/org/springframework/social/lastfm/api/impl/json/lists/AbstractLastFmListContainer.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.social.lastfm.api.impl.json.lists;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonCreator;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+
+/**
+ * @author Michael Lavelle
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+/**
+ * Container for a list of LastFm json objects - allows for automatic JSON binding from *either* a list of objects
+ * or a Map representation of a single object, as LastFm responds with different Json structures
+ * depending on whether a single object is returned or a number of objects
+ *
+ * @author Michael Lavelle
+ */
+public abstract class AbstractLastFmListContainer<T> {
+
+ protected List<T> elements;
+
+ @JsonCreator
+ public AbstractLastFmListContainer(List<T> elements) {
+ this.elements = elements;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonCreator
+ public AbstractLastFmListContainer(T element) {
+ this.elements = Arrays.asList(element);
+ }
+
+
+}
View
6 ...lastfm/api/impl/json/LastFmShoutListResponse.java → .../api/impl/json/lists/LastFmShoutListResponse.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.social.lastfm.api.impl.json;
+package org.springframework.social.lastfm.api.impl.json.lists;
import java.util.ArrayList;
import java.util.List;
@@ -22,14 +22,12 @@
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.springframework.social.lastfm.api.Shout;
-import org.springframework.social.lastfm.api.SimpleTrack;
-import org.springframework.social.lastfm.api.Track;
/**
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class LastFmShoutListResponse {
+public class LastFmShoutListResponse {
private ShoutListContainer shoutListContainer;
View
18 ...mpl/json/LastFmTrackSearchResultListResponse.java → ...on/lists/LastFmTrackSearchResultListResponse.java
@@ -13,13 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.social.lastfm.api.impl.json;
+package org.springframework.social.lastfm.api.impl.json.lists;
+import java.util.ArrayList;
import java.util.List;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
+import org.springframework.social.lastfm.api.LastFmProfile;
import org.springframework.social.lastfm.api.TrackSearchResult;
/**
@@ -28,16 +30,20 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class LastFmTrackSearchResultListResponse {
- private List<TrackSearchResult> tracks;
+ private TrackSearchResultListContainer trackSearchResultListContainer;
+
+ @JsonProperty("track")
+ public void setTrackSearchResultListContainer(TrackSearchResultListContainer trackSearchResultListContainer) {
+ this.trackSearchResultListContainer = trackSearchResultListContainer;
+ }
@JsonCreator
- public LastFmTrackSearchResultListResponse(
- @JsonProperty("track") List<TrackSearchResult> tracks) {
- this.tracks = tracks;
+ public LastFmTrackSearchResultListResponse() {
+ this.trackSearchResultListContainer = new TrackSearchResultListContainer(new ArrayList<TrackSearchResult>());
}
public List<TrackSearchResult> getTracks() {
- return tracks;
+ return trackSearchResultListContainer.getTrackSearchResults();
}
}
View
7 .../lastfm/api/impl/json/LastFmUserListResponse.java → ...m/api/impl/json/lists/LastFmUserListResponse.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.social.lastfm.api.impl.json;
+package org.springframework.social.lastfm.api.impl.json.lists;
import java.util.ArrayList;
import java.util.List;
@@ -22,9 +22,6 @@
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.springframework.social.lastfm.api.LastFmProfile;
-import org.springframework.social.lastfm.api.Shout;
-import org.springframework.social.lastfm.api.SimpleTrack;
-import org.springframework.social.lastfm.api.Track;
/**
* @author Michael Lavelle
@@ -36,7 +33,7 @@
@JsonProperty("user")
- public void setUsers(UserListContainer userListContainer) {
+ public void setUserListContainer(UserListContainer userListContainer) {
this.userListContainer = userListContainer;
}
View
18 ...cial/lastfm/api/impl/json/ShoutListContainer.java → ...astfm/api/impl/json/lists/ShoutListContainer.java
@@ -13,19 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.social.lastfm.api.impl.json;
+package org.springframework.social.lastfm.api.impl.json.lists;
-import java.util.Arrays;
import java.util.Date;
import java.util.List;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.lastfm.api.Artist;
import org.springframework.social.lastfm.api.Shout;
-import org.springframework.social.lastfm.api.SimpleTrack;
-import org.springframework.social.lastfm.api.Track;
/**
* @author Michael Lavelle
@@ -38,23 +33,20 @@
*
* @author Michael Lavelle
*/
-public class ShoutListContainer {
+public class ShoutListContainer extends AbstractLastFmListContainer<Shout> {
- private List<Shout> shouts;
@JsonCreator
public ShoutListContainer(List<Shout> shouts) {
- this.shouts = shouts;
+ super(shouts);
}
public ShoutListContainer(String message, Date date,String author) {
- this.shouts = Arrays
- .asList(new Shout(message,date,author));
+ super(new Shout(message,date,author));
}
-
public List<Shout> getShouts() {
- return shouts;
+ return elements;
}
}
View
69 src/main/java/org/springframework/social/lastfm/api/impl/json/lists/SimpleTrackListContainer.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.social.lastfm.api.impl.json.lists;
+
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonCreator;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.springframework.social.lastfm.api.Image;
+import org.springframework.social.lastfm.api.LastFmProfile;
+import org.springframework.social.lastfm.api.SimpleArtist;
+import org.springframework.social.lastfm.api.SimpleTrack;
+
+/**
+ * @author Michael Lavelle
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+/**
+ * Container for a list of Last.fm json object - allows for automatic JSON binding from *either* a list of objects
+ * or a Map representation of a single object, as LastFm responds with different Json structures
+ * depending on whether a single object is returned where a list can be.
+ *
+ * @author Michael Lavelle
+ */
+public class SimpleTrackListContainer extends AbstractLastFmListContainer<SimpleTrack> {
+
+
+ @JsonCreator
+ public SimpleTrackListContainer(List<SimpleTrack> simpleTracks) {
+ super(simpleTracks);
+ }
+
+
+ public SimpleTrackListContainer(String url, String name, String artistName) {
+ super(new SimpleTrack(url, name, artistName));
+
+ }
+
+ public SimpleTrackListContainer(String url, String name, String musicBrainsId,
+ String artistName) {
+ super(new SimpleTrack(url, name, musicBrainsId,artistName));
+
+ }
+
+ public SimpleTrackListContainer(String url, String name, String musicBrainsId,
+ SimpleArtist simpleArtist) {
+ super(new SimpleTrack(url,name,musicBrainsId,simpleArtist));
+
+ }
+
+ public List<SimpleTrack> getTracks()
+ {
+ return elements;
+ }
+
+}
View
13 ...cial/lastfm/api/impl/json/TrackListContainer.java → ...astfm/api/impl/json/lists/TrackListContainer.java
@@ -13,9 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.social.lastfm.api.impl.json;
+package org.springframework.social.lastfm.api.impl.json.lists;
-import java.util.Arrays;
import java.util.List;
import org.codehaus.jackson.annotate.JsonCreator;
@@ -31,23 +30,21 @@
*
* @author Michael Lavelle
*/
-public class TrackListContainer {
- private List<Track> tracks;
+public class TrackListContainer extends AbstractLastFmListContainer<Track> {
public TrackListContainer(String url, String name, String musicBrainsId,
Artist artist) {
- this.tracks = Arrays
- .asList(new Track(url, name, musicBrainsId, artist));
+ super(new Track(url, name, musicBrainsId, artist));
}
@JsonCreator
public TrackListContainer(List<Track> tracks) {
- this.tracks = tracks;
+ super(tracks);
}
public List<Track> getTracks() {
- return tracks;
+ return elements;
}
}
View
54 src/main/java/org/springframework/social/lastfm/api/impl/json/lists/TrackSearchResultListContainer.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.social.lastfm.api.impl.json.lists;
+
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonCreator;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.springframework.social.lastfm.api.Image;
+import org.springframework.social.lastfm.api.LastFmProfile;
+import org.springframework.social.lastfm.api.TrackSearchResult;
+
+/**
+ * @author Michael Lavelle
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+/**
+ * Container for a list of Last.fm json object - allows for automatic JSON binding from *either* a list of objects
+ * or a Map representation of a single object, as LastFm responds with different Json structures
+ * depending on whether a single object is returned where a list can be.
+ *
+ * @author Michael Lavelle
+ */
+public class TrackSearchResultListContainer extends AbstractLastFmListContainer<TrackSearchResult> {
+
+
+ @JsonCreator
+ public TrackSearchResultListContainer(List<TrackSearchResult> trackSearchResults) {
+ super(trackSearchResults);
+ }
+
+ public TrackSearchResultListContainer(String name, String artistName, String url) {
+ super(new TrackSearchResult(name,artistName,url));
+
+ }
+
+ public List<TrackSearchResult> getTrackSearchResults() {
+ return elements;
+ }
+
+}
View
24 ...ocial/lastfm/api/impl/json/UserListContainer.java → ...lastfm/api/impl/json/lists/UserListContainer.java
@@ -13,50 +13,42 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.social.lastfm.api.impl.json;
+package org.springframework.social.lastfm.api.impl.json.lists;
-import java.util.Arrays;
-import java.util.Date;
import java.util.List;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.lastfm.api.Artist;
import org.springframework.social.lastfm.api.Image;
import org.springframework.social.lastfm.api.LastFmProfile;
-import org.springframework.social.lastfm.api.Shout;
-import org.springframework.social.lastfm.api.SimpleTrack;
-import org.springframework.social.lastfm.api.Track;
/**
* @author Michael Lavelle
*/
@JsonIgnoreProperties(ignoreUnknown = true)
/**
- * Container for a shout list - allows for automatic JSON binding from *either* a list of Shouts
- * or a Map representation of a single shout, as LastFm responds with different Json structures
- * depending on whether a single shout is returned
+ * Container for a list of Last.fm users- allows for automatic JSON binding from *either* a list of objects
+ * or a Map representation of a single user, as LastFm responds with different Json structures
+ * depending on whether a single user is returned or a number of users
*
* @author Michael Lavelle
*/
-public class UserListContainer {
+public class UserListContainer extends AbstractLastFmListContainer<LastFmProfile> {
- private List<LastFmProfile> users;
@JsonCreator
public UserListContainer(List<LastFmProfile> users) {
- this.users = users;
+ super(users);
}
public UserListContainer(String id, String name, String realName, String url,
List<Image> images) {
- this.users = Arrays.asList(new LastFmProfile(id,name,realName,url,images));
+ super(new LastFmProfile(id,name,realName,url,images));
}
public List<LastFmProfile> getUsers() {
- return users;
+ return elements;
}
}
View
2  src/test/resources/org/springframework/social/lastfm/api/testdata/search-results.json
@@ -0,0 +1,2 @@
+{"results":{"opensearch:Query":{"#text":"","role":"request","searchTerms":"music","startPage":"1"},"opensearch:totalResults":"1431","opensearch:startIndex":"0","opensearch:itemsPerPage":"30","trackmatches":{"track":[{"name":"Music","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music","streamable":{"#text":"0","fulltrack":"0"},"listeners":"204385","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/34s\/63199741.png","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64s\/63199741.png","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/63199741.png","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/300x300\/63199741.png","size":"extralarge"}],"mbid":""},{"name":"Music Inferno","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+Inferno","streamable":{"#text":"0","fulltrack":"0"},"listeners":"11472","mbid":""},{"name":"Music Inferno [Live]","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+Inferno+%5BLive%5D","streamable":{"#text":"0","fulltrack":"0"},"listeners":"3073","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/34s\/68499450.png","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64s\/68499450.png","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/68499450.png","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/300x300\/68499450.png","size":"extralarge"}],"mbid":""},{"name":"Music [Live]","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+%5BLive%5D","streamable":{"#text":"0","fulltrack":"0"},"listeners":"2771","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/34s\/65688998.png","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64s\/65688998.png","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/65688998.png","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/300x300\/65688998.png","size":"extralarge"}],"mbid":""},{"name":"Music (Album Version)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+%28Album+Version%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"2638","mbid":""},{"name":"Music (Deep Dish Dot Com radio edit)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+%28Deep+Dish+Dot+Com+radio+edit%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"1673","image":[{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004X01U.01.MZZZZZZZ.jpg","size":"small"},{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004X01U.01.MZZZZZZZ.jpg","size":"medium"},{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004X01U.01.MZZZZZZZ.jpg","size":"large"},{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004X01U.01.MZZZZZZZ.jpg","size":"extralarge"}],"mbid":""},{"name":"Music 2008","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+2008","streamable":{"#text":"0","fulltrack":"0"},"listeners":"1614","mbid":""},{"name":"me against the music","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/me+against+the+music","streamable":{"#text":"0","fulltrack":"0"},"listeners":"1571","mbid":""},{"name":"Music (HQ2 club mix)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+%28HQ2+club+mix%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"1319","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/34s\/46046859.png","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64s\/46046859.png","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/46046859.png","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/300x300\/46046859.png","size":"extralarge"}],"mbid":""},{"name":"Music (Disco Inferno Mix)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+%28Disco+Inferno+Mix%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"1311","mbid":""},{"name":"Me Against The Music Video Mix (feat.Britney Spears)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Me+Against+The+Music+Video+Mix+%28feat.Britney+Spears%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"1198","mbid":""},{"name":"Music (Groove Armada club mix)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+%28Groove+Armada+club+mix%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"1144","mbid":""},{"name":"Last Night A DJ Saved My Life\/Music","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Last%2BNight%2BA%2BDJ%2BSaved%2BMy%2BLife%252FMusic","streamable":{"#text":"0","fulltrack":"0"},"listeners":"1067","mbid":""},{"name":"Music (Groove Armada 12_ Mix)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+%28Groove+Armada+12_+Mix%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"1050","mbid":""},{"name":"Music 2008 - Live","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+2008+-+Live","streamable":{"#text":"0","fulltrack":"0"},"listeners":"1008","mbid":""},{"name":"Music 2008 [Live]","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+2008+%5BLive%5D","streamable":{"#text":"0","fulltrack":"0"},"listeners":"995","mbid":""},{"name":"(Just Can't Get) Enough Music [Tristan Shout]","artist":"Depeche Mode Vs. Madonna","url":"http:\/\/www.last.fm\/music\/Depeche+Mode+Vs.+Madonna\/_\/%28Just+Can%27t+Get%29+Enough+Music+%5BTristan+Shout%5D","streamable":{"#text":"0","fulltrack":"0"},"listeners":"1221","mbid":""},{"name":"Charly Music","artist":"The Prodigy vs Madonna","url":"http:\/\/www.last.fm\/music\/The+Prodigy+vs+Madonna\/_\/Charly+Music","streamable":{"#text":"0","fulltrack":"0"},"listeners":"963","mbid":""},{"name":"Music (Deep Dish Dot Com remix)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+%28Deep+Dish+Dot+Com+remix%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"960","image":[{"#text":"","size":"small"},{"#text":"","size":"medium"},{"#text":"","size":"large"},{"#text":"","size":"extralarge"}],"mbid":""},{"name":"Music (Calderone radio edit)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+%28Calderone+radio+edit%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"910","image":[{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004Z1CR.01._SCMZZZZZZZ_.jpg","size":"small"},{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004Z1CR.01._SCMZZZZZZZ_.jpg","size":"medium"},{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004Z1CR.01._SCMZZZZZZZ_.jpg","size":"large"},{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004Z1CR.01._SCMZZZZZZZ_.jpg","size":"extralarge"}],"mbid":""},{"name":"Boogie Oogie Music","artist":"Madonna Vs A Taste Of Honey","url":"http:\/\/www.last.fm\/music\/Madonna+Vs+A+Taste+Of+Honey\/_\/Boogie+Oogie+Music","streamable":{"#text":"0","fulltrack":"0"},"listeners":"906","mbid":""},{"name":"Me Against The Music (Terminal Head Vocal)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Me+Against+The+Music+%28Terminal+Head+Vocal%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"893","mbid":""},{"name":"Music (Calderone Anthem mix)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+%28Calderone+Anthem+mix%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"853","image":[{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004X01U.01.MZZZZZZZ.jpg","size":"small"},{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004X01U.01.MZZZZZZZ.jpg","size":"medium"},{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004X01U.01.MZZZZZZZ.jpg","size":"large"},{"#text":"http:\/\/images.amazon.com\/images\/P\/B00004X01U.01.MZZZZZZZ.jpg","size":"extralarge"}],"mbid":""},{"name":"Music Inferno - Live","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+Inferno+-+Live","streamable":{"#text":"0","fulltrack":"0"},"listeners":"839","mbid":""},{"name":"Daft Punk Vs Madonna - Da Funk Music (White Label Mix)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Daft+Punk+Vs+Madonna+-+Da+Funk+Music+%28White+Label+Mix%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"838","mbid":""},{"name":"Wild Rock Music! [Smash]","artist":"Steppenwolf vs. Apollo 440 vs. Madonna vs. Ike & Tina Turner","url":"http:\/\/www.last.fm\/music\/Steppenwolf%2Bvs.%2BApollo%2B440%2Bvs.%2BMadonna%2Bvs.%2BIke%2B%2526%2BTina%2BTurner\/_\/Wild+Rock+Music%21+%5BSmash%5D","streamable":{"#text":"0","fulltrack":"0"},"listeners":"829","mbid":""},{"name":"Me Against The Music (featuring. Britney Spears)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Me+Against+The+Music+%28featuring.+Britney+Spears%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"820","mbid":""},{"name":"Like a Virgin \/ Hollywood Medley (feat. Christina Aguilera, Britney Spears & Missy Elliott) (2003: MTV Video Music Awards)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Like%2Ba%2BVirgin%2B%252F%2BHollywood%2BMedley%2B%2528feat.%2BChristina%2BAguilera%252C%2BBritney%2BSpears%2B%2526%2BMissy%2BElliott%2529%2B%25282003%253A%2BMTV%2BVideo%2BMusic%2BAwards%2529","streamable":{"#text":"0","fulltrack":"0"},"listeners":"793","mbid":""},{"name":"Music 2008 (Live)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+2008+%28Live%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"781","image":[{"#text":"http:\/\/userserve-ak.last.fm\/serve\/34s\/51162099.png","size":"small"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/64s\/51162099.png","size":"medium"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/126\/51162099.png","size":"large"},{"#text":"http:\/\/userserve-ak.last.fm\/serve\/300x300\/51162099.png","size":"extralarge"}],"mbid":""},{"name":"Music (HQ2 radio mix)","artist":"Madonna","url":"http:\/\/www.last.fm\/music\/Madonna\/_\/Music+%28HQ2+radio+mix%29","streamable":{"#text":"0","fulltrack":"0"},"listeners":"724","mbid":""}]},"@attr":{"for":"music"}}}
+
Please sign in to comment.
Something went wrong with that request. Please try again.