JSON-RPC
Quick Start
A quick start to using festivald
's JSON-RPC 2.0
API.
Create the Collection
and start playing an Artist
- First, scan the default
Music
directory onfestivald
's filesystem, and create aCollection
withcollection_new
:
festival-cli collection_new
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"collection_new","params":{"paths":null}}'
- Add the
Artist
"LUCKY TAPES" to the queue withqueue_add_map_artist
:
festival-cli queue_add_map_artist --artist "LUCKY TAPES"
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"queue_add_map_artist","params":{"artist":"LUCKY TAPES"}}'
- Start playing with
play
:
festival-cli play
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"play"}'
View state of current audio playback with state_audio
festival-cli state_audio
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"state_audio"}'
Set the volume to 10% with volume
festival-cli volume --volume 10
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"volume","params":{"volume":10}}'
View the current Album
with current_album
festival-cli current_album
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"current_album"}'
Clear the queue and stop playback with stop
festival-cli stop
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"stop"}'
Create and add an Artist
to a playlist with playlist_add_map_artist
festival-cli playlist_add_map_artist --playlist "Playlist Name" --artist "Artist Name" --append back
curl http://localhost:18425 -d '{"jsonrpc":"2.0","id":0,"method":"playlist_add_map_artist","params":{"playlist":"Playlist Name","artist":"Artist Name","append":"back","clear":false}}'