new Collection(spotifyopt)
Create a playlist collection.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
spotify |
SpotifyRequestHandler |
<optional> |
Spotify request handler. |
- Source:
Members
alternating
Playlist alternating.
- Source:
csv
Whether to output as CSV.
- Source:
entries
List of entries.
- Source:
grouping
Playlist grouping.
- Source:
lastfmUser
Last.fm user.
- Source:
ordering
Playlist order.
- Source:
reverse
Whether to reverse the playlist order.
- Source:
shuffle
Whether to shuffle the playlist.
- Source:
spotify
Spotify request handler.
- Source:
unique
Whether to remove duplicates.
- Source:
Methods
add(entry)
Add an entry to the end of the collection queue.
Parameters:
Name | Type | Description |
---|---|---|
entry |
Track | Album | Artist | The entry to add. |
- Source:
alternate()
Alternate the collection entries.
- Source:
dedup() → {Promise|Collection}
Remove duplicate entries.
- Source:
Returns:
- Itself.
- Type
- Promise | Collection
dispatch() → {Promise|Queue}
Dispatch all the entries in the collection.
- Source:
Returns:
A queue of results.
- Type
- Promise | Queue
execute() → {Promise|string}
Dispatch all the entries in the collection and return the track listing.
- Source:
Returns:
A newline-separated list of Spotify URIs.
- Type
- Promise | string
fetchLastfm() → {Promise|Queue}
Fetch Last.fm metadata of each collection entry.
- Source:
Returns:
A queue of results.
- Type
- Promise | Queue
fetchTracks() → {Promise}
Dispatch the entries in the collection.
- Source:
Returns:
A Promise to perform the action.
- Type
- Promise
group()
Group the collection entries.
- Source:
order() → {Promise}
Order the collection entries.
- Source:
Returns:
A Promise to perform the action.
- Type
- Promise
print()
Print the collection to the console.
- Source:
refreshTracks() → {Promise}
Refresh the metadata of each collection entry.
- Source:
Returns:
A Promise to perform the action.
- Type
- Promise
reorder() → {Promise|Collection}
Reverse the order of the entries.
- Source:
Returns:
- Itself.
- Type
- Promise | Collection
toString() → {string}
Convert the collection to a string.
- Source:
Returns:
A newline-separated list of Spotify URIs.
- Type
- string