Song


new Song(client, source)

A song that exsists in the MPD database

Parameters:
Name Type Description
client MPD

the MPD client object that owns this

source song_metadata

raw metadata javascript object that contains the MPD reported data for this song

Source:

Methods


getMetadata() → {song_metadata}

get the MPD reported metadata, raw

Source:
Returns:

gets the all of the raw metadata MPD provided

Type
song_metadata

getDisplayName() → {String}

get the best looking name for this song, prefer Title, fallback to something derived from filename

Source:
Returns:

a good looking display name for this sing, suitable for presenting to the user

Type
String

getPath() → {String}

get the filename

Source:
Returns:

the full path to the music file in MPD's music directory. relative path.

Type
String

getLastModified() → {Date}

when was the song file last altered

Source:
Returns:

when the song file last altered

Type
Date

getDuration() → {Number}

get the song's duration

Source:
Returns:

song duration in number of seconds

Type
Number

getArtist() → {String}

get the song's artist

Source:
Returns:

from the song metadata

Type
String

getTitle() → {String}

get the song's title

Source:
Returns:

from the song metadata

Type
String

getAlbum() → {String}

get the song's album

Source:
Returns:

from the song metadata

Type
String

getTrack() → {String}

get the song's track

Source:
Returns:

from the song metadata

Type
String

getGenre() → {String}

get the song's genre

Source:
Returns:

from the song metadata

Type
String

getDisk() → {String}

get the reported disk number from of the song, note this need not be a number or numeric, also need not exsist

Source:
Returns:

reported disk

Type
String

getQueueSong() → {QueueSong}

if this song is on the Queue, get the QueueSong

Source:
Returns:
Type
QueueSong

clone() → {Song}

return a copy of this object. the point of this is to return an object that the used cannot use to mutate this one, but that has the exact same behaviour

Source:
Returns:
Type
Song