de.umass.lastfm
public class Playlist extends Object
fetch
method and various fetchXXX
methods to retrieve playlists from the server. Playlists are identified by lastfm:// playlist urls. Valid urls
include:
Modifier and Type | Method and Description |
---|---|
static Result |
addTrack(int playlistId,
String artist,
String track,
Session session)
Add a track to a Last.fm user's playlist.
|
static Playlist |
create(String title,
String description,
Session session)
Creates a Last.fm playlist.
|
static Playlist |
fetch(String playlistUrl,
String apiKey)
Fetches a playlist using a lastfm playlist url.
|
static Playlist |
fetchAlbumPlaylist(String albumId,
String apiKey)
Fetches an album playlist, which contains the tracks of the specified album.
|
static Playlist |
fetchTagPlaylist(String tag,
String apiKey)
Fetches a playlist of freetracks for a given tag name.
|
static Playlist |
fetchUserPlaylist(int playlistId,
String apiKey)
Fetches a user-created playlist.
|
String |
getAnnotation() |
String |
getCreator() |
int |
getId() |
int |
getSize() |
String |
getTitle() |
Collection<Track> |
getTracks() |
public String getCreator()
public int getId()
public int getSize()
public String getTitle()
public String getAnnotation()
public Collection<Track> getTracks()
public static Playlist fetchAlbumPlaylist(String albumId, String apiKey)
albumId
- The album id as returned in Album.getInfo
.apiKey
- A Last.fm API key.public static Playlist fetchUserPlaylist(int playlistId, String apiKey)
playlistId
- A playlist id.apiKey
- A Last.fm API key.public static Playlist fetchTagPlaylist(String tag, String apiKey)
tag
- A tag name.apiKey
- A Last.fm API key.public static Playlist fetch(String playlistUrl, String apiKey)
playlistUrl
- A valid playlist url.apiKey
- A Last.fm API key.public static Result addTrack(int playlistId, String artist, String track, Session session)
playlistId
- The ID of the playlist - this is available in user.getPlaylistsartist
- The artist name that corresponds to the track to be added.track
- The track name to add to the playlist.session
- A Session instance.