Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some refactoring, adding getLovedTracks,getTopTracks,scrobble and upd…
…ateNowPlaying
- Loading branch information
1 parent
962345a
commit c485e4f
Showing
23 changed files
with
603 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/org/springframework/social/lastfm/api/Artist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.springframework.social.lastfm.api; | ||
|
||
/** | ||
* @author Michael Lavelle | ||
*/ | ||
public class Artist { | ||
|
||
public String getMusicBrainsId() { | ||
return musicBrainsId; | ||
} | ||
|
||
public void setMusicBrainsId(String musicBrainsId) { | ||
this.musicBrainsId = musicBrainsId; | ||
} | ||
|
||
private String url; | ||
private String name; | ||
private String musicBrainsId; | ||
|
||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Artist(String url, String name,String musicBrainsId) { | ||
this.url = url; | ||
this.name = name; | ||
this.musicBrainsId = musicBrainsId; | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/org/springframework/social/lastfm/api/ArtistDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.springframework.social.lastfm.api; | ||
|
||
public interface ArtistDescriptor { | ||
|
||
public String getName(); | ||
public String getMusicBrainsId(); | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/org/springframework/social/lastfm/api/SimpleArtist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.springframework.social.lastfm.api; | ||
|
||
public class SimpleArtist implements ArtistDescriptor { | ||
|
||
private String name; | ||
private String musicBrainsId; | ||
|
||
public SimpleArtist(String name,String musicBrainsId) | ||
{ | ||
this.name = name; | ||
this.musicBrainsId = musicBrainsId; | ||
} | ||
|
||
public SimpleArtist(String name) | ||
{ | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getMusicBrainsId() { | ||
return musicBrainsId; | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/org/springframework/social/lastfm/api/SimpleTrack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.springframework.social.lastfm.api; | ||
|
||
/** | ||
* @author Michael Lavelle | ||
*/ | ||
public class SimpleTrack extends SimpleTrackDescriptor { | ||
|
||
private String url; | ||
|
||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
|
||
public SimpleTrack(String url, String name,String musicBrainsId,String artistName) { | ||
super(artistName,name,musicBrainsId); | ||
this.url = url; | ||
|
||
} | ||
|
||
public SimpleTrack(String url, String name,String musicBrainsId,SimpleArtist simpleArtist) { | ||
super(simpleArtist,name,musicBrainsId); | ||
this.url = url; | ||
|
||
} | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
src/main/java/org/springframework/social/lastfm/api/SimpleTrackDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package org.springframework.social.lastfm.api; | ||
|
||
/** | ||
* @author Michael Lavelle | ||
*/ | ||
public class SimpleTrackDescriptor implements TrackDescriptor { | ||
|
||
private String name; | ||
private ArtistDescriptor artistDescriptor; | ||
private String musicBrainsId; | ||
|
||
public SimpleTrackDescriptor(String artistName,String name,String musicBrainsId) | ||
{ | ||
this.name = name; | ||
this.artistDescriptor = new SimpleArtist(artistName); | ||
this.musicBrainsId = musicBrainsId; | ||
} | ||
|
||
public SimpleTrackDescriptor(ArtistDescriptor artistDescriptor,String name,String musicBrainsId) | ||
{ | ||
this.name = name; | ||
this.artistDescriptor = artistDescriptor; | ||
this.musicBrainsId = musicBrainsId; | ||
} | ||
|
||
|
||
|
||
|
||
public SimpleTrackDescriptor(String artistName,String name) | ||
{ | ||
this.name = name; | ||
this.artistDescriptor = new SimpleArtist(artistName); | ||
} | ||
|
||
public SimpleTrackDescriptor(String musicBrainsId) | ||
{ | ||
this.musicBrainsId = musicBrainsId; | ||
|
||
} | ||
|
||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public String getArtistName() { | ||
return artistDescriptor == null ? null : artistDescriptor.getName(); | ||
} | ||
|
||
@Override | ||
public String getMusicBrainsId() { | ||
return musicBrainsId; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/org/springframework/social/lastfm/api/TrackDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.springframework.social.lastfm.api; | ||
|
||
/** | ||
* @author Michael Lavelle | ||
*/ | ||
public interface TrackDescriptor { | ||
|
||
public String getName(); | ||
public String getArtistName(); | ||
public String getMusicBrainsId(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.