|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.umass.lastfm.ImageHolder
de.umass.lastfm.MusicEntry
de.umass.lastfm.Track
Bean that contains information related to Track
s and provides bindings to methods
in the track.
namespace.
Field Summary | |
protected String |
album
|
static String |
ALBUM_PAGE
|
static String |
ARTIST_PAGE
|
protected int |
duration
|
protected Map |
lastFmExtensionInfos
|
protected String |
location
|
static int |
ScrobbleResultType_MULTIPLE_SCROBBLES
|
static int |
ScrobbleResultType_NOW_PLAYING
|
static int |
ScrobbleResultType_SINGLE_SCROBBLE
|
static String |
TRACK_PAGE
|
Fields inherited from class de.umass.lastfm.MusicEntry |
id, listeners, mbid, name, percentageChange, playcount, streamable, tags, url, userPlaycount |
Fields inherited from class de.umass.lastfm.ImageHolder |
imageUrls |
Constructor Summary | |
protected |
Track(String name,
String url,
String artist)
|
protected |
Track(String name,
String url,
String mbid,
int playcount,
int listeners,
boolean streamable,
String artist,
String artistMbid,
boolean fullTrackAvailable,
boolean nowPlaying)
|
Method Summary | |
static Result |
addTags(String artist,
String track,
String tags,
Session session)
Tag an album using a list of user supplied tags. |
static Result |
ban(String artist,
String track,
Session session)
Ban a track for a given user profile. |
String |
getAlbum()
|
String |
getAlbumMbid()
|
String |
getArtist()
|
String |
getArtistMbid()
|
static Collection |
getBuylinks(String artist,
String albumOrMbid,
String country,
String apiKey)
Get a list of Buy Links for a particular Track. |
static Track |
getCorrection(String artist,
String track,
String apiKey)
Use the last.fm corrections data to check whether the supplied track has a correction to a canonical track. |
int |
getDuration()
Returns the duration of the song, if available, in seconds. |
static Track |
getInfo(String artist,
String trackOrMbid,
Locale locale,
String username,
String apiKey)
Get the metadata for a track on Last.fm using the artist/track name or a musicbrainz id. |
static Track |
getInfo(String artist,
String trackOrMbid,
String apiKey)
Get the metadata for a track on Last.fm using the artist/track name or a musicbrainz id. |
String |
getLastFmInfo(String key)
Returns last.fm specific information about this Track. |
String |
getLocation()
Returns the location (URL) of this Track. |
Date |
getPlayedWhen()
Returns the time when the track was played, if this data is available (e.g. |
int |
getPosition()
Returns the position of this track in its associated album, or -1 if not available. |
static PaginatedResult |
getShouts(String artist,
String trackOrMbid,
int page,
int limit,
String apiKey)
Get shouts for a track. |
static PaginatedResult |
getShouts(String artist,
String trackOrMbid,
int page,
String apiKey)
Get shouts for a track. |
static PaginatedResult |
getShouts(String artist,
String trackOrMbid,
String apiKey)
Get shouts for a track. |
static Collection |
getSimilar(String artist,
String trackOrMbid,
String apiKey)
Get the similar tracks for this track on Last.fm, based on listening data. You have to provide either an artist and a track name or an mbid. |
static Collection |
getTags(String artist,
String track,
Session session)
Get the tags applied by an individual user to an track on Last.fm. |
static Collection |
getTopFans(String artist,
String trackOrMbid,
String apiKey)
Retrieves the top fans for the given track. |
static Collection |
getTopTags(String artist,
String trackOrMbid,
String apiKey)
Retrieves the top tags for the given track. |
boolean |
isFullTrackAvailable()
|
boolean |
isNowPlaying()
|
static Result |
love(String artist,
String track,
Session session)
Love a track for a user profile. |
static Result |
removeTag(String artist,
String track,
String tag,
Session session)
Remove a user's tag from a track. |
static List |
scrobble(List scrobbleData,
Session session)
|
static ScrobbleResult |
scrobble(ScrobbleData scrobbleData,
Session session)
|
static ScrobbleResult |
scrobble(String artistName,
String trackName,
int timestamp,
Session session)
|
static Collection |
search(String track,
String apiKey)
Searches for a track with the given name and returns a list of possible matches. |
static Collection |
search(String artist,
String track,
int limit,
String apiKey)
Searches for a track with the given name and returns a list of possible matches. |
static Result |
share(String artist,
String track,
String message,
String recipient,
Session session)
Share a track twith one or more Last.fm users or other friends. |
String |
toString()
|
static Result |
unban(String artist,
String track,
Session session)
UnBan a track for a given user profile. |
static Result |
unlove(String artist,
String track,
Session session)
UnLove a track for a user profile. |
static ScrobbleResult |
updateNowPlaying(ScrobbleData scrobbleData,
Session session)
|
static ScrobbleResult |
updateNowPlaying(String artistName,
String trackName,
Session session)
|
Methods inherited from class de.umass.lastfm.MusicEntry |
getId, getListeners, getMbid, getName, getPercentageChange, getPlaycount, getSimilarityMatch, getTags, getUrl, getUserPlaycount, getWikiLastChanged, getWikiSummary, getWikiText, isStreamable, loadStandardInfo |
Methods inherited from class de.umass.lastfm.ImageHolder |
availableSizes, getImageURL, loadImages |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ScrobbleResultType_NOW_PLAYING
public static final int ScrobbleResultType_SINGLE_SCROBBLE
public static final int ScrobbleResultType_MULTIPLE_SCROBBLES
public static final String ARTIST_PAGE
public static final String ALBUM_PAGE
public static final String TRACK_PAGE
protected String album
protected int duration
protected String location
protected Map lastFmExtensionInfos
Constructor Detail |
protected Track(String name, String url, String artist)
protected Track(String name, String url, String mbid, int playcount, int listeners, boolean streamable, String artist, String artistMbid, boolean fullTrackAvailable, boolean nowPlaying)
Method Detail |
public int getDuration()
Playlist.fetch
and
Track.getInfo
.
public String getArtist()
public String getArtistMbid()
public String getAlbum()
public String getAlbumMbid()
public boolean isFullTrackAvailable()
public boolean isNowPlaying()
public String getLocation()
Radio
services.
public String getLastFmInfo(String key)
key
- A key
ARTIST_PAGE
,
ALBUM_PAGE
,
TRACK_PAGE
public Date getPlayedWhen()
null
,
if this data is not available.
null
public int getPosition()
public static Collection search(String track, String apiKey)
track
- Track nameapiKey
- The API key
search(String, String, int, String)
public static Collection search(String artist, String track, int limit, String apiKey)
null
for the artist parameter if you want to specify a limit but don't want
to define an artist.
artist
- Artist's name or null
track
- Track namelimit
- Number of maximum resultsapiKey
- The API key
public static Collection getTopTags(String artist, String trackOrMbid, String apiKey)
null
for the first parameter.
artist
- Artist name or null
if an MBID is specifiedtrackOrMbid
- Track name or MBIDapiKey
- The API key
public static Collection getTopFans(String artist, String trackOrMbid, String apiKey)
null
for the first parameter.
artist
- Artist name or null
if an MBID is specifiedtrackOrMbid
- Track name or MBIDapiKey
- The API key
public static Result addTags(String artist, String track, String tags, Session session)
artist
- The artist name in questiontrack
- The track name in questiontags
- A comma delimited list of user supplied tags to apply to this track. Accepts a maximum of 10 tags.session
- A Session instance.
public static Result removeTag(String artist, String track, String tag, Session session)
artist
- The artist name in questiontrack
- The track name in questiontag
- A single user tag to remove from this track.session
- A Session instance.
public static Result share(String artist, String track, String message, String recipient, Session session)
artist
- An artist name.track
- A track name.message
- A message to send with the recommendation or null
. If not supplied a default message will be used.recipient
- A comma delimited list of email addresses or Last.fm usernames. Maximum is 10.session
- A Session instance
public static Result love(String artist, String track, Session session)
artist
- An artist nametrack
- A track namesession
- A Session instance
public static Result unlove(String artist, String track, Session session)
artist
- An artist nametrack
- A track namesession
- A Session instance
public static Result ban(String artist, String track, Session session)
artist
- An artist nametrack
- A track namesession
- A Session instance
public static Result unban(String artist, String track, Session session)
artist
- An artist nametrack
- A track namesession
- A Session instance
public static Collection getSimilar(String artist, String trackOrMbid, String apiKey)
null
for parameters you don't need.
artist
- The artist name in questiontrackOrMbid
- The track name in question or the track's MBIDapiKey
- A Last.fm API key.
Track
spublic static Collection getTags(String artist, String track, Session session)
artist
- The artist name in questiontrack
- The track name in questionsession
- A Session instance
public static Track getInfo(String artist, String trackOrMbid, String apiKey)
artist
- The artist name in question or null
if an mbid is specifiedtrackOrMbid
- The track name in question or the musicbrainz id for the trackapiKey
- A Last.fm API key.
public static Track getInfo(String artist, String trackOrMbid, Locale locale, String username, String apiKey)
artist
- The artist name in question or null
if an mbid is specifiedtrackOrMbid
- The track name in question or the musicbrainz id for the tracklocale
- The language to fetch info in, or null
username
- The username for the context of the request, or null
. If supplied, the user's playcount for this track and whether they have loved the track is included in the responseapiKey
- A Last.fm API key.
public static Collection getBuylinks(String artist, String albumOrMbid, String country, String apiKey)
artist
- The artist name in questionalbumOrMbid
- Track name or MBIDcountry
- A country name, as defined by the ISO 3166-1 country names standardapiKey
- A Last.fm API key
BuyLink
spublic static Track getCorrection(String artist, String track, String apiKey)
Track
object containing the corrected data, or null
if the supplied Artist/Track combination was not found.
artist
- The artist name to correcttrack
- The track name to correctapiKey
- A Last.fm API key
Track
, or null
public static PaginatedResult getShouts(String artist, String trackOrMbid, String apiKey)
artist
- The artist nametrackOrMbid
- The track name or a mausicbrainz idapiKey
- A Last.fm API key.
Shout
spublic static PaginatedResult getShouts(String artist, String trackOrMbid, int page, String apiKey)
artist
- The artist nametrackOrMbid
- The track name or a mausicbrainz idpage
- The page number to fetchapiKey
- A Last.fm API key.
Shouts
public static PaginatedResult getShouts(String artist, String trackOrMbid, int page, int limit, String apiKey)
artist
- The artist nametrackOrMbid
- The track name or a mausicbrainz idpage
- The page number to fetchlimit
- An integer used to limit the number of shouts returned per page or -1 for defaultapiKey
- A Last.fm API key.
Shout
spublic static ScrobbleResult scrobble(ScrobbleData scrobbleData, Session session)
public static ScrobbleResult scrobble(String artistName, String trackName, int timestamp, Session session)
public static List scrobble(List scrobbleData, Session session)
public static ScrobbleResult updateNowPlaying(ScrobbleData scrobbleData, Session session)
public static ScrobbleResult updateNowPlaying(String artistName, String trackName, Session session)
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |