SimpleTrack

@Serializable
data class SimpleTrack(externalUrlsString: Map<String, String>, availableMarketsString: List<String> = listOf(), externalIdsString: Map<String, String> = hashMapOf(), val href: String, val id: String, val uri: SpotifyUri, val artists: List<SimpleArtist>, val discNumber: Int, val durationMs: Int, val explicit: Boolean, val isPlayable: Boolean = true, val linkedTrack: LinkedTrack? = null, val name: String, val previewUrl: String? = null, val trackNumber: Int, val type: String, val isLocal: Boolean? = null, val popularity: Double? = null, val restrictions: Restrictions? = null) : RelinkingAvailableResponse(source)

Simplified Playlist object that can be used to retrieve a full Playlist

Parameters

artists

The artists who performed the track. Each artist object includes a link in href to more detailed information about the artist. identified by their ISO 3166-1 alpha-2 code.

discNumber

The disc number (usually 1 unless the album consists of more than one disc).

durationMs

The track length in milliseconds.

explicit

Whether or not the track has explicit lyrics ( true = yes it does; false = no it does not OR unknown).

href

A link to the Web API endpoint providing full details of the track.

id

The Spotify ID for the track.

isPlayable

Part of the response when Track Relinking is applied. If true , the track is playable in the given market. Otherwise false.

name

The name of the track.

previewUrl

A URL to a 30 second preview (MP3 format) of the track.

trackNumber

The number of the track. If an album has several discs, the track number is the number on the specified disc.

type

The object type: “track”.

isLocal

Whether or not the track is from a local file.

popularity

the popularity of this track. possibly null

restrictions

Part of the response when Track Relinking is applied, the original track is not available in the given market, and Spotify did not have any tracks to relink it with. The track response will still contain metadata for the original track, and a restrictions object containing the reason why the track is not available: "restrictions" : {"reason" : "market"}

Constructors

Link copied to clipboard
constructor(externalUrlsString: Map<String, String>, availableMarketsString: List<String> = listOf(), externalIdsString: Map<String, String> = hashMapOf(), href: String, id: String, uri: SpotifyUri, artists: List<SimpleArtist>, discNumber: Int, durationMs: Int, explicit: Boolean, isPlayable: Boolean = true, linkedTrack: LinkedTrack? = null, name: String, previewUrl: String? = null, trackNumber: Int, type: String, isLocal: Boolean? = null, popularity: Double? = null, restrictions: Restrictions? = null)

Properties

Link copied to clipboard
@Transient
lateinit var api: GenericSpotifyApi

The API client associated with the request

Link copied to clipboard
Link copied to clipboard

A list of the countries in which the track can be played.

Link copied to clipboard
@SerialName(value = "disc_number")
val discNumber: Int
Link copied to clipboard
@SerialName(value = "duration_ms")
val durationMs: Int
Link copied to clipboard
Link copied to clipboard

External IDs for this track.

Link copied to clipboard

Known external URLs for this object

Link copied to clipboard
open override val href: String
Link copied to clipboard
open override val id: String
Link copied to clipboard
@SerialName(value = "is_local")
val isLocal: Boolean? = null
Link copied to clipboard
@SerialName(value = "is_playable")
val isPlayable: Boolean = true
Link copied to clipboard
val length: Int

The track length in milliseconds. Alias of durationMs

Link copied to clipboard
@SerialName(value = "linked_from")
open override val linkedTrack: LinkedTrack? = null

Part of the response when Track Relinking is applied and is only part of the response if the track linking, in fact, exists. The requested track has been replaced with a different track. The track contains information about the originally requested track.

Link copied to clipboard
Link copied to clipboard
val popularity: Double? = null
Link copied to clipboard
@SerialName(value = "preview_url")
val previewUrl: String? = null
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "track_number")
val trackNumber: Int
Link copied to clipboard
Link copied to clipboard
open override val uri: SpotifyUri

The URI associated with the object

Functions

Link copied to clipboard

Check if this response has been relinked.

Link copied to clipboard
suspend fun toFullTrack(market: Market? = null): Track?

Converts this SimpleTrack into a full Track object with the given market

Link copied to clipboard

Converts this SimpleTrack into a full Track object with the given market