public class Playlist extends Model
| Constructor and Description |
|---|
Playlist()
Instantiates a new Playlist.
|
Playlist(java.lang.String name)
Instantiates a new Playlist.
|
| Modifier and Type | Method and Description |
|---|---|
Playlist |
addMediaFiles(Client client,
java.util.List<java.lang.String> tokens)
Add Media Files to a CustomPlaylist.
|
Playlist |
create(Client client)
Creates a new CustomPlaylist or SmartPlaylist depending on the input parameters.
|
boolean |
destroy(Client client)
Permanently destroy a playlist.
|
boolean |
equals(java.lang.Object other) |
Albums |
getAlbums(Client client)
Gets media files grouped by albums.
|
Artists |
getArtists(Client client)
Gets media files grouped by albums.
|
java.util.List<? extends MediaFile> |
getFingerprints(Client client)
Returns known file fingerprints for this playlist.
|
java.util.List<? extends MediaFile> |
getFingerprints(Client client,
com.google.api.client.json.JsonObjectParser parser)
Returns known file fingerprints for this playlist.
|
Genres |
getGenres(Client client)
Gets media files grouped by albums.
|
java.util.List<MediaFile> |
getMediaFiles(Client client)
Same as
getMediaFiles(fm.audiobox.core.Client, long, String) but
all media file fields are returned and *no* time filter is applied. |
java.util.List<MediaFile> |
getMediaFiles(Client client,
com.google.api.client.json.JsonObjectParser parser)
Returns media files linked to the specified playlist token along with primary information.
|
java.util.List<MediaFile> |
getMediaFiles(Client client,
long since)
Same as
getMediaFiles(fm.audiobox.core.Client, long, String) but
all media file fields are returned. |
java.util.List<MediaFile> |
getMediaFiles(Client client,
long since,
java.lang.String set)
Returns media files linked to the specified playlist token along with primary information.
|
java.util.List<MediaFile> |
getMediaFiles(Client client,
long since,
java.lang.String set,
com.google.api.client.json.JsonObjectParser parser)
Returns media files linked to the specified playlist token along with primary information.
|
long |
getMediaFilesCount()
Gets media files count on this playlist.
|
java.lang.String |
getName()
Gets the playlist name.
|
static java.lang.String |
getPath()
Gets the generic remote resource path (token interpolation needed,
see
ModelUtil.interpolate(String, String) ). |
long |
getPosition()
Gets the position of the playlist (client application should respect this field while sorting playlists).
|
java.lang.String |
getSystemName()
Gets system name.
|
java.lang.String |
getToken()
Gets playlist unique token.
|
java.lang.String |
getType()
Gets the playlist type.
|
java.lang.String |
getUpdatedAt()
Gets the last time (in form of an UTC String) this playlist have been changed.
|
int |
hashCode() |
boolean |
isEmbeddable()
Use this method to check if the playlist is embeddable or not.
|
boolean |
isLastAccessed()
Use this method to check if the playlist is the last one accessed.
|
boolean |
isSyncable()
Checks if this playlist supports syncing with remote content, usually valid for external storage services.
|
boolean |
isVisible()
Use this method to check if the playlist is visible or not.
|
Playlist |
removeMediaFiles(Client client,
java.util.List<java.lang.String> tokens)
Remove Media Files from a CustomPlaylist.
|
Playlist |
setEmbeddable(boolean embeddable)
Changes embeddable value, if you want to persist the change
remember to call
update(fm.audiobox.core.Client)
method. |
void |
setLastAccessed(boolean lastAccessed)
Sets as last accessed.
|
void |
setMediaFilesCount(long mediaFilesCount)
Sets media files count.
|
Playlist |
setName(java.lang.String name)
Changes playlist name, if you want to persist the change
remember to call
update(fm.audiobox.core.Client)
method. |
Playlist |
setPosition(long position)
Changes position value, if you want to persist the change
remember to call
update(fm.audiobox.core.Client)
method. |
void |
setSyncable(boolean syncable)
Sets syncable.
|
void |
setSystemName(java.lang.String systemName)
Sets system name.
|
void |
setToken(java.lang.String token)
Sets token.
|
void |
setType(java.lang.String type)
Sets type.
|
void |
setUpdatedAt(java.lang.String updatedAt)
Sets updated at.
|
Playlist |
setVisible(boolean visible)
Changes visible value, if you want to persist the change
remember to call
update(fm.audiobox.core.Client)
method. |
boolean |
sync(Client client)
Begin content sync with the remote platform.
|
boolean |
toggleVisibility(Client client)
Toggle visibility mode for this playlist.
|
Playlist |
update(Client client)
Handle the update of a custom or smart playlist.
|
getProp, notifyObservers, setProppublic Playlist()
public Playlist(java.lang.String name)
name - the name of the playlistpublic Playlist create(Client client) throws java.io.IOException
client - the clientAudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic Playlist update(Client client) throws java.io.IOException
search_params can be set only on creation and thus cannot be changed, in this action.
SmartPlaylist cannot be tweaked in their search_params due to the complexity of their construct.
Since SmartPlaylist are compiled on demand, just destroy the old and create a new one.client - the clientjava.lang.IllegalStateException - if the playlist is not persisted yet.ForbiddenException - if no valid subscription foundResourceNotFoundException - if playlist is not found or immutableValidationException - if playlist data is not valid (ex: name already taken)AudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic boolean destroy(Client client) throws java.io.IOException
client - the client to use for the requestAudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic boolean sync(Client client) throws java.io.IOException
client - the client to use for the requestSyncException - if any problem occurs.AudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic boolean toggleVisibility(Client client) throws java.io.IOException
Toggle visibility mode for this playlist.
By toggling the visibility attribute clients should avoid to render the playlist marked with visible: false or grey them out.
Non visible playlists retains their functionality, they just should be hidden in views.
client - the client to use for the requestAudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic java.util.List<MediaFile> getMediaFiles(Client client) throws java.io.IOException
getMediaFiles(fm.audiobox.core.Client, long, String) but
all media file fields are returned and *no* time filter is applied.client - the client to use for the requestMediaFile elementsAudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic java.util.List<MediaFile> getMediaFiles(Client client, com.google.api.client.json.JsonObjectParser parser) throws java.io.IOException
Returns media files linked to the specified playlist token along with primary information.
This does not return all the attributes for a MediaFile, instead it returns an optimized JSON for fast view-level rendering and parsing purposes. Full details about a particular MediaFile can be obtained by calling the dedicated show endpoint.
Supports a comma separated 'set' parameter which indicates which attributes to render, like 'type,token' so a developer can just ask the needed attributes.
Supports a datetime 'since' parameter that filters the collection and returns records modified since the specified date.
Remote and third party Cloud Storage services' content can be accessed through this endpoint, however an error will be returned if the user has no valid authentication information stored towards the service in question or has an invalid subscription. For example if the user tries to access the Dropbox playlist but he has not the related account linked a ForbiddenException will be thrown, along with the subscription status. Valid subscription statuses are active and trialing.
client - the client to use for the requestparser - the parser to use to parse the responseMediaFile elementsAudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic java.util.List<MediaFile> getMediaFiles(Client client, long since) throws java.io.IOException
getMediaFiles(fm.audiobox.core.Client, long, String) but
all media file fields are returned.
client - the client to use for the requestsince - unix timestamp that filters the collection and returns records modified since the specified date.MediaFile elementsAudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic java.util.List<MediaFile> getMediaFiles(Client client, long since, java.lang.String set) throws java.io.IOException
Returns media files linked to the specified playlist token along with primary information.
This does not return all the attributes for a MediaFile, instead it returns an optimized JSON for fast view-level rendering and parsing purposes. Full details about a particular MediaFile can be obtained by calling the dedicated show endpoint.
Supports a comma separated 'set' parameter which indicates which attributes to render, like 'type,token' so a developer can just ask the needed attributes.
Supports a datetime 'since' parameter that filters the collection and returns records modified since the specified date.
Remote and third party Cloud Storage services' content can be accessed through this endpoint, however an error will be returned if the user has no valid authentication information stored towards the service in question or has an invalid subscription. For example if the user tries to access the Dropbox playlist but he has not the related account linked a ForbiddenException will be thrown, along with the subscription status. Valid subscription statuses are active and trialing.
client - the client to use for the requestsince - unix timestamp that filters the collection and returns records modified since the specified date.set - comma separated 'set' parameter which indicates which attributes to render, like 'type,token', null will return all available fields.MediaFile elementsAudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic java.util.List<MediaFile> getMediaFiles(Client client, long since, java.lang.String set, com.google.api.client.json.JsonObjectParser parser) throws java.io.IOException
Returns media files linked to the specified playlist token along with primary information.
This does not return all the attributes for a MediaFile, instead it returns an optimized JSON for fast view-level rendering and parsing purposes. Full details about a particular MediaFile can be obtained by calling the dedicated show endpoint.
Supports a comma separated 'set' parameter which indicates which attributes to render, like 'type,token' so a developer can just ask the needed attributes.
Supports a datetime 'since' parameter that filters the collection and returns records modified since the specified date.
Remote and third party Cloud Storage services' content can be accessed through this endpoint, however an error will be returned if the user has no valid authentication information stored towards the service in question or has an invalid subscription. For example if the user tries to access the Dropbox playlist but he has not the related account linked a ForbiddenException will be thrown, along with the subscription status. Valid subscription statuses are active and trialing.
client - the client to use for the requestsince - unix timestamp that filters the collection and returns records modified since the specified date.set - comma separated 'set' parameter which indicates which attributes to render, like 'type,token', null will return all available fields.parser - the parser to use to parse the responseMediaFile elementsAudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic Albums getAlbums(Client client) throws java.io.IOException
ForbiddenException if the user is not enabled to view this playlist due
to bad subscription state or missing AudioMash link.
Throws ResourceNotFoundException if the playlist does not exists.client - the Client to use for the requestAlbums data.AudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic Genres getGenres(Client client) throws java.io.IOException
ForbiddenException if the user is not enabled to view this playlist due
to bad subscription state or missing AudioMash link.
Throws ResourceNotFoundException if the playlist does not exists.client - the Client to use for the requestAlbums data.AudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic Artists getArtists(Client client) throws java.io.IOException
ForbiddenException if the user is not enabled to view this playlist due
to bad subscription state or missing AudioMash link.
Throws ResourceNotFoundException if the playlist does not exists.client - the Client to use for the requestAlbums data.AudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic Playlist addMediaFiles(Client client, java.util.List<java.lang.String> tokens) throws java.io.IOException
client - the Client to use for the requesttokens - the list of the tokens string to add to this playlistjava.lang.IllegalStateException - if the playlist is not persisted yet.ResourceNotFoundException - if the playlist not found or not of type CustomPlaylist.AudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic Playlist removeMediaFiles(Client client, java.util.List<java.lang.String> tokens) throws java.io.IOException
client - the Client to use for the requesttokens - the list of the tokens string to add to this playlistjava.lang.IllegalStateException - if the playlist is not persisted yet.ResourceNotFoundException - if the playlist not found or not of type CustomPlaylist.AudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic java.util.List<? extends MediaFile> getFingerprints(Client client) throws java.io.IOException
client - the Client to use for the requestMediaFile elementsAudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic java.util.List<? extends MediaFile> getFingerprints(Client client, com.google.api.client.json.JsonObjectParser parser) throws java.io.IOException
client - the Client to use for the requestparser - the parser to use to parse the responseMediaFile elementsAudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic static java.lang.String getPath()
ModelUtil.interpolate(String, String) ).public java.lang.String getToken()
public java.lang.String getName()
public Playlist setName(java.lang.String name)
update(fm.audiobox.core.Client)
method.name - the namepublic java.lang.String getSystemName()
public java.lang.String getType()
public long getMediaFilesCount()
public long getPosition()
public Playlist setPosition(long position)
update(fm.audiobox.core.Client)
method.position - the position to setpublic boolean isEmbeddable()
public Playlist setEmbeddable(boolean embeddable)
update(fm.audiobox.core.Client)
method.embeddable - true to mark it as embeddable, false to disable the feature.public boolean isVisible()
public Playlist setVisible(boolean visible)
update(fm.audiobox.core.Client)
method.visible - true to mark it as visible, false to disable the feature.public boolean isLastAccessed()
Client.getPlaylist(String) was called at last}public java.lang.String getUpdatedAt()
public boolean isSyncable()
public void setToken(java.lang.String token)
token - the tokenpublic void setSystemName(java.lang.String systemName)
systemName - the system namepublic void setType(java.lang.String type)
type - the typepublic void setMediaFilesCount(long mediaFilesCount)
mediaFilesCount - the media files countpublic void setLastAccessed(boolean lastAccessed)
lastAccessed - true if the playlist was the last accessed.public void setUpdatedAt(java.lang.String updatedAt)
updatedAt - last time updatedpublic void setSyncable(boolean syncable)
syncable - the syncablepublic final boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Object