queue_add_rand_song

🟡 Incomplete

This API's output may have additions in the future.


Add a random Song to the queue.

Inputs

FieldTypeDescription
appendstring, one of front, back or indexSee Queue/Append
clearbooleanShould the queue be cleared before adding?
playbooleanShould we start playing?
indexoptional (maybe-null) unsigned integerIf the index append is chosen, this will be the index used

Outputs

FieldTypeDescription
songSong objectThe Song that was added to the queue

Example Request 1

Add to back of the queue.

festival-cli queue_add_rand_song --append back
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"queue_add_rand_song","params":{"append":"back","clear":false,"play":false}}'

Example Request 2

Insert at queue index 4.

festival-cli queue_add_rand_song --append index --index 4
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"queue_add_rand_song","params":{"append":"index","clear":false,"play":false,"index":4}}'

Example Request 3

Clear the queue, add to front of queue.

festival-cli queue_add_rand_song --append front --clear --play
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"queue_add_rand_song","params":{"append":"front","clear":true,"play":true}}'

Example Response

{
  "jsonrpc": "2.0",
  "result": {
    "song": {
      "title": "SUNFLOWER",
      "key": 2594,
      "album": 237,
      "runtime": 252,
      "sample_rate": 44100,
      "track": 1,
      "disc": null,
      "mime": "audio/mpeg",
      "extension": "mp3"
    }
  },
  "id": 0
}