Playlists and REST API

Hello,

i’m running Volumio Version 3.251. I’m struggling to properly use playlists and especially the REST-API to play playlists.

Playing a playlist from the frontend, does not work itself. I have to add the playlist to the queue and then start the queue. Looking at the log doesnt really help in this case besides a misleading error that implies that my playlist is not in the correct folder (the correct folder is /data/playlists/ not /mnt/playlists/)

Dec 11 14:38:08 audioplayer volumio[676]: info: CoreCommandRouter::volumioReplaceandPlayItems
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreStateMachine::ClearQueue
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreStateMachine::stop
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreStateMachine::setConsumeUpdateService undefined
Dec 11 14:38:08 audioplayer volumio[676]: verbose: UNSET VOLATILE
Dec 11 14:38:08 audioplayer volumio[676]: info: CorePlayQueue::clearPlayQueue
Dec 11 14:38:08 audioplayer volumio[676]: info: CorePlayQueue::saveQueue
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreCommandRouter::volumioPushState
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreCommandRouter::volumioPushQueue
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreStateMachine::addQueueItems
Dec 11 14:38:08 audioplayer volumio[676]: info: CorePlayQueue::addQueueItems
Dec 11 14:38:08 audioplayer volumio[676]: info: Adding Item to queue: playlists/OCCULT.json
Dec 11 14:38:08 audioplayer volumio[676]: info: Exploding uri playlists/OCCULT.json in service mpd
Dec 11 14:38:08 audioplayer volumio[676]: error: scanFolder - failure to stat '/mnt/playlists/OCCULT.json'
Dec 11 14:38:08 audioplayer volumio[676]: info: CorePlayQueue::saveQueue
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreCommandRouter::volumioPushQueue
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreStateMachine::updateTrackBlock
Dec 11 14:38:08 audioplayer volumio[676]: info: CorePlayQueue::getTrackBlock
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreCommandRouter::volumioPlay
Dec 11 14:38:08 audioplayer volumio[676]: verbose: UNSET VOLATILE
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreStateMachine::play index 0
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreStateMachine::setConsumeUpdateService undefined
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreStateMachine::stop
Dec 11 14:38:08 audioplayer volumio[676]: info: CoreStateMachine::setConsumeUpdateService undefined
Dec 11 14:38:08 audioplayer volumio[676]: verbose: UNSET VOLATILE
Dec 11 14:38:09 audioplayer volumio[676]: info: CoreStateMachine::play index undefined
Dec 11 14:38:09 audioplayer volumio[676]: info: CoreStateMachine::setConsumeUpdateService undefined
Dec 11 14:38:09 audioplayer volumio[676]: info: CorePlayQueue::getTrack 0
Dec 11 14:38:10 audioplayer volumio[676]: info: CoreCommandRouter::volumioGetState
Dec 11 14:38:10 audioplayer volumio[676]: info: CorePlayQueue::getTrack 0
Dec 11 14:38:20 audioplayer volumio[676]: info: CoreCommandRouter::volumioGetState
Dec 11 14:38:20 audioplayer volumio[676]: info: CorePlayQueue::getTrack 0
Dec 11 14:38:20 audioplayer volumio[676]: info: Listing playlists
Dec 11 14:38:20 audioplayer volumio[676]: info: Listing playlists
Dec 11 14:38:30 audioplayer volumio[676]: info: CoreCommandRouter::volumioGetState
Dec 11 14:38:30 audioplayer volumio[676]: info: CorePlayQueue::getTrack 0
Dec 11 14:38:40 audioplayer volumio[676]: info: CoreCommandRouter::volumioGetState
Dec 11 14:38:40 audioplayer volumio[676]: info: CorePlayQueue::getTrack 0
Dec 11 14:38:40 audioplayer volumio[676]: info: Listing playlists
Dec 11 14:38:40 audioplayer volumio[676]: info: Listing playlists

Looking for that issue I just found a github issue, but that was with volumio2, but is still open → Playlist options are broken · Issue #1965 · volumio/Volumio2 · GitHub

Now knowing the workaround, I can live with the bug, but I want to control my volumio partly via the REST API. I have found some kind of documentation REST_API.

According to the documentation I should be able to play a playlist with the following command

curl "volumio.local/api/v1/commands/?cmd=playplaylist&name=OCCULT.json"

Sending this command does trigger nothing except log messages that make it look like it should work

Dec 11 14:45:35 audioplayer volumio[676]: info:
Dec 11 14:45:35 audioplayer volumio[676]: ---------------------------- Client requests Volumio Play Playlist OCCULT.JSON
Dec 11 14:45:35 audioplayer volumio[676]: info: Play playlist OCCULT.JSON

Can you guys please tell me what exactly I’m doing wrong?

Your passing the wrong command. Remove the .JSON, like:
curl "volumio.local/api/v1/commands/?cmd=playplaylist&name=OCCULT"

1 Like

It didnt solve my issue but it lead me in the right direction. I’ve noticed that the API always returns a “playplaylist Success” response no matter what playlist I specify, even if it does not exist.

The playlist I’ve used to test on was not generated with volumio but rather with a script I wrote to bulk generate playlists ( volumio y u no m3u). Apparently it really doesnt like it when the title doesnt match the song title. I fixed that and now the API call works for me.

If you do a lot with playlist, have a look at Cantata.
It can send dynamical playlists (when running on Linux) to Volumio.