Package de.umass.lastfm
Class Playlist
java.lang.Object
de.umass.lastfm.Playlist
Bean for music playlists. Contains the
fetch
method and various fetchXXX
methods to retrieve playlists from the server. Playlists are identified by lastfm:// playlist urls. Valid urls
include:
- Album Playlists: lastfm://playlist/album/<album_id>
- User Playlists: lastfm://playlist/<playlist_id>
- Tag Playlists: lastfm://playlist/tag/<tag_name>/freetracks
- Author:
- Janni Kovacs
-
Method Summary
Modifier and TypeMethodDescriptionstatic Result
Add a track to a Last.fm user's playlist.static Playlist
Creates a Last.fm playlist.static Playlist
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.int
getId()
int
getSize()
getTitle()
-
Method Details
-
getCreator
-
getId
public int getId() -
getSize
public int getSize() -
getTitle
-
getAnnotation
-
getTracks
-
fetchAlbumPlaylist
Fetches an album playlist, which contains the tracks of the specified album.- Parameters:
albumId
- The album id as returned inAlbum.getInfo
.apiKey
- A Last.fm API key.- Returns:
- a playlist
-
fetchUserPlaylist
Fetches a user-created playlist.- Parameters:
playlistId
- A playlist id.apiKey
- A Last.fm API key.- Returns:
- a playlist
-
fetchTagPlaylist
Fetches a playlist of freetracks for a given tag name.- Parameters:
tag
- A tag name.apiKey
- A Last.fm API key.- Returns:
- a playlist
-
fetch
Fetches a playlist using a lastfm playlist url. See the class description for a list of valid playlist urls.- Parameters:
playlistUrl
- A valid playlist url.apiKey
- A Last.fm API key.- Returns:
- a playlist
-
addTrack
Add a track to a Last.fm user's playlist.- Parameters:
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.- Returns:
- the result of the operation
-
create
Creates a Last.fm playlist.- Parameters:
title
- A title for the playlistdescription
- A description for the playlistsession
- A Session instance- Returns:
- the result of the operation
-