Library spotify

v1.0.0Adam Yarris

Entities

Recommender A recommender that generates a list of tracks based on a set of seed artists, genres, or tracks. Various parameters are allowed to fine-tune recommendations. Any unchanged parameters will be ignored. Spotify gives definitions for the "max", "min", and "target" parameters. A minimum parameter: A ha...

Global Functions

native fun addToPlaylist(playlist, songList) Adds the given song list to the given playlist.
native fun createPlaylist(name) Creates a new playlist with the given name.
native fun createPlaylist(name, desc) Creates a new playlist with the given name and description.
native fun disableBlockingQueue() When songs are played, they are added to the queue immediately.
fun enableBlockingQueue() When songs are played, they are added to the queue when the currently playing song ends. The first 2 songs will be added immediately as a buffer, but sequential ones will wait for the song to end befo...
native fun enableBlockingQueue(fastPolling) When songs are played, they are added to the queue when the currently playing song ends. The first 2 songs will be added immediately as a buffer, but sequential ones will wait for the song to end befo...
fun onSongPlay(fn) Calls a callback function when the currently playing song is changed on a Spotify account, with a polling time of 5000ms.
native fun onSongPlay(fn, pollTime) Calls a callback function when the currently playing song is changed on a Spotify account.

Extension Functions

native fun addToPlaylist(playlist, songList) link

Adds the given song list to the given playlist.

Params
playlist ( collection )

The playlist to add the songs to

songList ( list )

The list of songs to add to the playlist

spotify:playlist_tools.ql
native fun createPlaylist(name) link

Creates a new playlist with the given name.

Params
name ( string )

The name of the playlist

Returns collection

The created playlist

spotify:playlist_tools.ql
native fun createPlaylist(name, desc) link

Creates a new playlist with the given name and description.

Params
name ( string )

The name of the playlist

desc ( string )

The description of the playlist

Returns collection

The created playlist

spotify:playlist_tools.ql
native fun disableBlockingQueue() link

When songs are played, they are added to the queue immediately.

spotify:blocking_queue.ql
fun enableBlockingQueue() link

When songs are played, they are added to the queue when the currently playing song ends. The first 2 songs will be added immediately as a buffer, but sequential ones will wait for the song to end before being added to the queue to not spam the queue.

spotify:blocking_queue.ql
native fun enableBlockingQueue(fastPolling) link

When songs are played, they are added to the queue when the currently playing song ends. The first 2 songs will be added immediately as a buffer, but sequential ones will wait for the song to end before being added to the queue to not spam the queue.

Params
fastPolling ( boolean )

If true, the queue will be polled every 5 seconds. If false, it will be polled at roughly 75% of the time left on the current song.

spotify:blocking_queue.ql
fun onSongPlay(fn) link

Calls a callback function when the currently playing song is changed on a Spotify account, with a polling time of 5000ms.

Params
fn ( function )

The function to call with the song as an argument

spotify:hooks.ql
native fun onSongPlay(fn, pollTime) link

Calls a callback function when the currently playing song is changed on a Spotify account.

Params
fn ( function )

The function to call with the song as an argument

pollTime ( int )

The milliseconds to wait between polling

spotify:hooks.ql