public class Track extends LfmEntity implements MusicBrainzEntity, NameEntity, UrlEntity, PlayCountEntity, UserPlayCountEntity, IdEntity, DurationEntity, StreamableEntity, DateEntity, RankEntity, AlbumEntity, NowPlayingEntity, ArtistEntity
| Constructor and Description |
|---|
Track(Element element)
Create a track from a dom4j element.
|
Track(String name) |
| Modifier and Type | Method and Description |
|---|---|
Album |
getAlbum() |
List<Album> |
getAlbums() |
Artist |
getArtist() |
Date |
getDate() |
Long |
getDuration() |
Long |
getId() |
static UnauthenticatedGetQuery<Track> |
getInfo(String artist,
String track,
String mbid,
String username)
Get the metadata for a track on Last.fm using the artist/track name or a musicbrainz id.
|
Integer |
getListeners() |
Float |
getMatch() |
String |
getMbid() |
String |
getName() |
Boolean |
getNowPlaying() |
Integer |
getPlayCount() |
Integer |
getRank() |
static UnauthenticatedGetQuery<ArrayList<Track>> |
getSimilar(String track,
String artist,
String mbid,
Boolean autocorrect,
Integer limit)
Get the similar tracks for this track on Last.fm, based on listening data.
|
Streamable |
getStreamable() |
List<Tag> |
getTags() |
URL |
getUrl() |
Integer |
getUserPlayCount() |
Wiki |
getWiki() |
static PostQuery<Scrobble> |
scrobble(String artist,
String track,
Long startTime,
String album,
Integer trackNumber,
String mbid,
String albumArtist,
Long duration,
String sessionKey)
Used to add a track-play to a user's profile.
|
void |
setAlbum(Album album) |
void |
setAlbums(List<Album> albums) |
void |
setArtist(Artist artist) |
void |
setDate(Date date) |
void |
setDuration(Long duration) |
void |
setId(Long id) |
void |
setListeners(Integer listeners) |
void |
setMatch(Float match) |
void |
setMbid(String mbid) |
void |
setName(String name) |
void |
setNowPlaying(Boolean nowPlaying) |
void |
setPlayCount(Integer playCount) |
void |
setRank(Integer rank) |
void |
setStreamable(Streamable streamable) |
void |
setTags(List<Tag> tags) |
void |
setUrl(URL url) |
void |
setUserPlayCount(Integer userPlayCount) |
void |
setWiki(Wiki wiki) |
public Track(String name)
public Track(Element element)
element - The dom4j element to convert.public final String getName()
getName in interface NameEntitypublic final Date getDate()
getDate in interface DateEntitypublic final void setDate(Date date)
setDate in interface DateEntitypublic final void setName(String name)
setName in interface NameEntitypublic final Integer getListeners()
getListeners in interface ListenersEntitypublic final void setStreamable(Streamable streamable)
setStreamable in interface StreamableEntitypublic final Streamable getStreamable()
getStreamable in interface StreamableEntitypublic final String getMbid()
getMbid in interface MbidEntitypublic final Integer getPlayCount()
getPlayCount in interface PlayCountEntitypublic final Integer getRank()
getRank in interface RankEntitypublic final void setListeners(Integer listeners)
setListeners in interface ListenersEntitypublic final void setMbid(String mbid)
setMbid in interface MbidEntitypublic final void setPlayCount(Integer playCount)
setPlayCount in interface PlayCountEntitypublic final void setRank(Integer rank)
setRank in interface RankEntitypublic Album getAlbum()
getAlbum in interface AlbumEntitypublic void setAlbum(Album album)
setAlbum in interface AlbumEntitypublic final Artist getArtist()
getArtist in interface ArtistEntitypublic final void setArtist(Artist artist)
setArtist in interface ArtistEntitypublic final Float getMatch()
public final void setMatch(Float match)
public Boolean getNowPlaying()
getNowPlaying in interface NowPlayingEntitypublic void setNowPlaying(Boolean nowPlaying)
setNowPlaying in interface NowPlayingEntitypublic final Long getDuration()
getDuration in interface DurationEntitypublic final void setDuration(Long duration)
setDuration in interface DurationEntitypublic final Wiki getWiki()
public final void setWiki(Wiki wiki)
public final Integer getUserPlayCount()
getUserPlayCount in interface UserPlayCountEntitypublic final void setUserPlayCount(Integer userPlayCount)
setUserPlayCount in interface UserPlayCountEntitypublic static UnauthenticatedGetQuery<Track> getInfo(String artist, String track, String mbid, String username)
artist - The artist name (Required (unless mbid).track - The track name (Required (unless mbid).mbid - The musicbrainz id for the track (Optional).username - The username for the context of the request (Optional). If supplied, the user's
playcount for this track and whether they have loved the track is included in the
response.public static UnauthenticatedGetQuery<ArrayList<Track>> getSimilar(String track, String artist, String mbid, Boolean autocorrect, Integer limit)
track - The track name (Optional).artist - The artist name (Optional).mbid - The musicbrainz id for the track (Optional).autocorrect - Transform misspelled artist and track names into correct artist and track names,
returning the correct version instead (Optional). The corrected artist and track
name will be returned in the response. TODO: currently the corrected originally
requested artist/trackname will NOT be returned.limit - Maximum number of similar tracks to return (Optional).public static PostQuery<Scrobble> scrobble(String artist, String track, Long startTime, String album, Integer trackNumber, String mbid, String albumArtist, Long duration, String sessionKey)
artist - The artist name (Required).track - The track name (Required).startTime - The time the track started playing in UNIX timestamp format in milliseconds
(Required).album - The album name (Optional).trackNumber - The track number of the track on the album (Optional).mbid - The MusicBrainz Track ID (Optional).albumArtist - The album artist - if this differs from the track artist (Optional).duration - The length of the track in milliseconds (Optional).sessionKey - A session key generated by authenticating a user via the authentication protocol.Copyright © 2012. All Rights Reserved.