Track

data class Track(val id: String, val title: String, val type: Track.Type = Type.Song, val cover: ImageHolder? = null, val artists: List<Artist> = listOf(), val album: Album? = null, val duration: Long? = null, val playedDuration: Long? = null, val plays: Long? = null, val releaseDate: Date? = null, val description: String? = null, val background: ImageHolder? = cover, val genres: List<String> = listOf(), val isrc: String? = null, val albumOrderNumber: Long? = null, val albumDiscNumber: Long? = null, val playlistAddedDate: Date? = null, val isExplicit: Boolean = false, val subtitle: String? = null, val extras: Map<String, String> = mapOf(), val isPlayable: Track.Playable = Playable.Yes, val streamables: List<Streamable> = listOf(), val isRadioSupported: Boolean = true, val isFollowable: Boolean = false, val isSaveable: Boolean = true, val isLikeable: Boolean = true, val isHideable: Boolean = true, val isShareable: Boolean = true) : EchoMediaItem

A class representing a track that can be played in Echo.

See also

Constructors

Link copied to clipboard
constructor(id: String, title: String, type: Track.Type = Type.Song, cover: ImageHolder? = null, artists: List<Artist> = listOf(), album: Album? = null, duration: Long? = null, playedDuration: Long? = null, plays: Long? = null, releaseDate: Date? = null, description: String? = null, background: ImageHolder? = cover, genres: List<String> = listOf(), isrc: String? = null, albumOrderNumber: Long? = null, albumDiscNumber: Long? = null, playlistAddedDate: Date? = null, isExplicit: Boolean = false, subtitle: String? = null, extras: Map<String, String> = mapOf(), isPlayable: Track.Playable = Playable.Yes, streamables: List<Streamable> = listOf(), isRadioSupported: Boolean = true, isFollowable: Boolean = false, isSaveable: Boolean = true, isLikeable: Boolean = true, isHideable: Boolean = true, isShareable: Boolean = true)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed interface Playable
Link copied to clipboard

Properties

Link copied to clipboard
val album: Album? = null

The album of the track

Link copied to clipboard
val albumDiscNumber: Long? = null

The disc number of the track in the album

Link copied to clipboard
val albumOrderNumber: Long? = null

The order number of the track in the album, if albumDiscNumber is not null, this is the order number in that disc

Link copied to clipboard

The artists of the track

Link copied to clipboard
open override val background: ImageHolder?

The background image of the track

Link copied to clipboard

The streamable backgrounds of the track.

Link copied to clipboard
open override val cover: ImageHolder? = null

The cover of the track

Link copied to clipboard
open override val description: String? = null

The description of the track

Link copied to clipboard
val duration: Long? = null

The duration of the track in milliseconds

Link copied to clipboard
open override val extras: Map<String, String>

Any extra data you want to associate with the track

Link copied to clipboard

The genres of the track

Link copied to clipboard
open override val id: String

The id of the track

Link copied to clipboard
open override val isExplicit: Boolean = false

Whether the track is explicit

Link copied to clipboard
open override val isFollowable: Boolean = false

Whether the track can be followed. Checkout FollowClient

Link copied to clipboard
open override val isHideable: Boolean = true

Whether the track can be hidden. Checkout HideClient

Link copied to clipboard
open override val isLikeable: Boolean = true

Whether the track can be liked. Checkout LikeClient

Link copied to clipboard

Whether the track is playable.

Link copied to clipboard
open val isPrivate: Boolean
Link copied to clipboard
open override val isRadioSupported: Boolean = true

Whether the track can used to create a radio. Checkout RadioClient

Link copied to clipboard
val isrc: String? = null

The IRSC code of the track

Link copied to clipboard
open override val isSaveable: Boolean = true

Whether the track can be saved to library. Checkout SaveClient

Link copied to clipboard
open override val isShareable: Boolean = true

Whether the track can be shared. Checkout ShareClient

Link copied to clipboard
val playedDuration: Long? = null

The duration of the track that has been played, in milliseconds

Link copied to clipboard
val playlistAddedDate: Date? = null

The date when the track was added to a playlist

Link copied to clipboard
val plays: Long? = null

The number of plays of the track

Link copied to clipboard
val releaseDate: Date? = null

The release date of the track

Link copied to clipboard

The streamable servers of the track.

Link copied to clipboard

The streamables of the track

Link copied to clipboard
open override val subtitle: String? = null

The subtitle of the track, used to display information under the title

Link copied to clipboard

The streamable subtitles of the track.

Link copied to clipboard
open override val subtitleWithE: <Error class: unknown class>
Link copied to clipboard
open override val subtitleWithOutE: String
Link copied to clipboard
open override val title: String

The title of the track

Link copied to clipboard

The type of the track, can be Audio, Video, or HorizontalVideo

Functions

Link copied to clipboard
open fun copyMediaItem(id: String = this.id, title: String = this.title, cover: ImageHolder? = this.cover, description: String? = this.description, subtitle: String? = this.subtitle, extras: Map<String, String> = this.extras, isRadioSupported: Boolean = this.isRadioSupported, isFollowable: Boolean = this.isFollowable, isSaveable: Boolean = this.isSaveable): EchoMediaItem
Link copied to clipboard
open fun sameAs(other: EchoMediaItem): Boolean
Link copied to clipboard
open fun toShelf(): Shelf.Item