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 | Class and Description |
---|---|
private static class |
Playlist.PlaylistFactory |
Modifier and Type | Field and Description |
---|---|
private String |
annotation |
private String |
creator |
(package private) static ItemFactory<Playlist> |
FACTORY |
private int |
id |
private int |
size |
private String |
title |
private List<Track> |
tracks |
Modifier | Constructor and Description |
---|---|
private |
Playlist() |
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() |
List<Track> |
getTracks() |
static final ItemFactory<Playlist> FACTORY
private int id
private String annotation
private int size
private Playlist()
public String getCreator()
public int getId()
public int getSize()
public String getAnnotation()
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.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses