I tweaked this nifty nugget from sideshowbob for the Nanosound CD plugin, but can’t get the autoplay. I think it’s because of a longer delay for Volumio CD items to become available. Running the playcd.sh
script works and plays the CD. Could anybody help me with this? ta
/home/volumio/playcd.sh
#!/bin/bash
sleep 5m
curl localhost:3000/api/v1/v1/browse?uri=audiocd | jq '.navigation.lists[0].items' > myjson.txt
curl -i --header "Content-Type: application/json" localhost:3000/api/v1/commands/?cmd=clearQueue
curl -i --header "Content-Type: application/json" localhost:3000/api/v1/addToQueue --data "$(cat myjson.txt)"
# curl -i --header "Content-Type: application/json" localhost:3000/api/v1/commands/?cmd=volume&volume=50
curl -i --header "Content-Type: application/json" localhost:3000/api/v1/commands/?cmd=play
/etc/udev/rules.d/99-local.rules
KERNEL=="sr[0-9]", ACTION=="change", ENV{ID_CDROM_MEDIA}=="1", ENV{ID_CDROM_MEDIA_STATE}!="blank", RUN+="/home/volumio/playcd.sh &"