new Playlist( spotify, data )

Description

Represents the playlist.

Parameters
Name Type Description
spotify Spotify

The spotify client.

data object

The playlist object data.

Details

Members


spotify :Spotify

Description

The spotify client.

Details

Methods


play( options ) → {Promise.<(Status|HTTPError|ApiError)>}

Description

Shortcut to play the playlist.

Parameters
Name Type Description
options StartOptions
Returns

modify( options ) → {Promise.<(Status|HTTPError|ApiError)>}

Description

Shortcut to modify the playlist.

Parameters
Name Type Description
options ModifyOptions
Returns

add( uris [, position ] ) → {Promise.<(Status|HTTPError|ApiError)>}

Description

Shortcut to add tracks to a playlist.

Parameters
Name Type Attributes Default Description
uris string | Array.<string>

A list of Spotify URIs to add, can be track or episode URIs.

position number <optional>
0

The position to insert the items, a zero-based index.

Returns

remove( uris [, snapshot ] ) → {Promise.<(Status|HTTPError|ApiError)>}

Description

Shortcut to remove a track from a playlist.

Parameters
Name Type Attributes Description
uris string | Array.<string>

A list of Spotify URIs to remove, can be track or episode URIs. Maximum: 100

snapshot string <optional>

The playlist's snapshot ID against which you want to make the changes.

Returns

follow() → {Promise.<(Status|HTTPError|ApiError)>}

Description

Shortcut to follow the playlist.

Returns

unfollow() → {Promise.<(Status|HTTPError|ApiError)>}

Description

Shortcut to unfollow the playlist.

Returns

following( users ) → {Promise.<(Array.<boolean>|HTTPError|ApiError)>}

Description

Shortcut to check user's following the playlist.

Parameters
Name Type Description
users string | Array.<string>

A list of Spotify User IDs.

Returns

cover( [ image ] ) → {Promise.<(Image|Status|HTTPError|ApiError)>}

Description

Shortcut to upload cover art to a playlist.

Parameters
Name Type Attributes Description
image string <optional>

The Base64 image encoded to upload as cover art.

Returns