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(AudioBoxClient audioBoxClient,
java.util.List<java.lang.String> tokens)
Add Media Files to a CustomPlaylist.
|
Playlist |
create(AudioBoxClient audioBoxClient)
Creates a new CustomPlaylist or SmartPlaylist depending on the input parameters.
|
boolean |
destroy(AudioBoxClient audioBoxClient)
Permanently destroy a playlist.
|
boolean |
equals(java.lang.Object other) |
Albums |
getAlbums(AudioBoxClient audioBoxClient)
Gets media files grouped by albums.
|
Artists |
getArtists(AudioBoxClient audioBoxClient)
Gets media files grouped by albums.
|
java.lang.String |
getDescription()
Gets this playlist brief description.
|
java.util.List<? extends MediaFile> |
getFingerprints(AudioBoxClient audioBoxClient)
Returns known file fingerprints for this playlist.
|
java.util.List<? extends MediaFile> |
getFingerprints(AudioBoxClient audioBoxClient,
com.google.api.client.json.JsonObjectParser parser)
Returns known file fingerprints for this playlist.
|
Genres |
getGenres(AudioBoxClient audioBoxClient)
Gets media files grouped by albums.
|
java.util.List<MediaFile> |
getMediaFiles(AudioBoxClient audioBoxClient)
Same as
getMediaFiles(fm.audiobox.core.AudioBoxClient, long, String) but
all media file fields are returned and *no* time filter is applied. |
java.util.List<MediaFile> |
getMediaFiles(AudioBoxClient audioBoxClient,
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(AudioBoxClient audioBoxClient,
long since)
Same as
getMediaFiles(fm.audiobox.core.AudioBoxClient, long, String) but
all media file fields are returned. |
java.util.List<MediaFile> |
getMediaFiles(AudioBoxClient audioBoxClient,
long since,
java.lang.String set)
Returns media files linked to the specified playlist token along with primary information.
|
java.util.List<MediaFile> |
getMediaFiles(AudioBoxClient audioBoxClient,
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 |
isCustom()
Checks if the playlist is a custom one.
|
boolean |
isDrive()
Checks if the playlist represents a cloud drive.
|
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 |
isOffline()
Checks if the playlist is the offline items playlist.
|
boolean |
isSmart()
Checks if the playlist is a smart one.
|
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(AudioBoxClient audioBoxClient,
java.util.List<java.lang.String> tokens)
Remove Media Files from a CustomPlaylist.
|
Playlist |
setDescription(java.lang.String description)
Sets a brief description of the playlist.
|
Playlist |
setEmbeddable(boolean embeddable)
Changes embeddable value, if you want to persist the change
remember to call
update(fm.audiobox.core.AudioBoxClient)
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.AudioBoxClient)
method. |
Playlist |
setPosition(long position)
Changes position value, if you want to persist the change
remember to call
update(fm.audiobox.core.AudioBoxClient)
method. |
void |
setSyncable(boolean syncable)
Sets syncable property.
|
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.AudioBoxClient)
method. |
boolean |
sync(AudioBoxClient audioBoxClient)
Begin content sync with the remote platform.
|
boolean |
toggleVisibility(AudioBoxClient audioBoxClient)
Toggle visibility mode for this playlist.
|
Playlist |
update(AudioBoxClient audioBoxClient)
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(AudioBoxClient audioBoxClient) throws java.io.IOException
audioBoxClient - the clientAudioBoxException - if any of the remote error exception is detected.java.io.IOException - if any connection problem occurs.AudioBoxExceptionpublic Playlist update(AudioBoxClient audioBoxClient) 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.audioBoxClient - 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(AudioBoxClient audioBoxClient) throws java.io.IOException
audioBoxClient - 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(AudioBoxClient audioBoxClient) throws java.io.IOException
audioBoxClient - 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(AudioBoxClient audioBoxClient) 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.
audioBoxClient - 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(AudioBoxClient audioBoxClient) throws java.io.IOException
getMediaFiles(fm.audiobox.core.AudioBoxClient, long, String) but
all media file fields are returned and *no* time filter is applied.audioBoxClient - 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(AudioBoxClient audioBoxClient, 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.
audioBoxClient - 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(AudioBoxClient audioBoxClient, long since) throws java.io.IOException
getMediaFiles(fm.audiobox.core.AudioBoxClient, long, String) but
all media file fields are returned.
audioBoxClient - 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(AudioBoxClient audioBoxClient, 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.
audioBoxClient - 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(AudioBoxClient audioBoxClient, 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.
audioBoxClient - 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(AudioBoxClient audioBoxClient) 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.audioBoxClient - the AudioBoxClient 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(AudioBoxClient audioBoxClient) 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.audioBoxClient - the AudioBoxClient 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(AudioBoxClient audioBoxClient) 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.audioBoxClient - the AudioBoxClient 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(AudioBoxClient audioBoxClient, java.util.List<java.lang.String> tokens) throws java.io.IOException
audioBoxClient - the AudioBoxClient 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(AudioBoxClient audioBoxClient, java.util.List<java.lang.String> tokens) throws java.io.IOException
audioBoxClient - the AudioBoxClient 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(AudioBoxClient audioBoxClient) throws java.io.IOException
audioBoxClient - the AudioBoxClient 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(AudioBoxClient audioBoxClient, com.google.api.client.json.JsonObjectParser parser) throws java.io.IOException
audioBoxClient - the AudioBoxClient 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.AudioBoxClient)
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.AudioBoxClient)
method.position - the position to setpublic boolean isEmbeddable()
public Playlist setEmbeddable(boolean embeddable)
update(fm.audiobox.core.AudioBoxClient)
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.AudioBoxClient)
method.visible - true to mark it as visible, false to disable the feature.public boolean isLastAccessed()
AudioBoxClient.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 Playlist setDescription(java.lang.String description)
description - a brief String to describe this playlistpublic java.lang.String getDescription()
public boolean isCustom()
public boolean isSmart()
public boolean isOffline()
public boolean isDrive()
public final boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Object