Skip to content

Song

Immutable provider-neutral identity and display fields.

PluginData is declared by the owning SourcePlugin; core stores the reference and never reads, clones, freezes or interprets it.

Type Parameter Default type
PluginData unknown

new Song<PluginData>(data): Song<PluginData>

Parameter Type
data SongData<PluginData>

Song<PluginData>

readonly optional ageRestricted?: boolean

True when the provider marks the media for adults, false when it says it is not, absent when it did not say. Core never acts on it.


readonly optional artist?: string


readonly optional duration?: number


readonly id: string


readonly name: string


readonly pluginData: PluginData


readonly source: string


readonly thumbnails: readonly Thumbnail[]


readonly url: string

get formattedDuration(): string

h:mm:ss from one hour, otherwise m:ss; Live when no duration is known.

string


get thumbnail(): string | undefined

The best image: the last of thumbnails.

string | undefined