![]() |
[IDEA] Extend URL API to clear / load / play a playlist - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8) +--- Thread: [IDEA] Extend URL API to clear / load / play a playlist (/showthread.php?tid=1068) |
Extend URL API to clear / load / play a playlist - tristanc - 02-06-2019 I don’t think this is implemented currently, but I think it would be really useful to have a “play playlist x” URL. You can do volume and stop via URLs, but not play. My use case is unusual, but might extend to others’ uses. I only listen to AirPlay or one of two radio stations for 99% of the time. I have 4 physical control buttons on a “remote” Pi which is used to control Moode. Vol Up press: http request Vol Down press: http request Radio 4: ssh connection made to issue the clear / load / play command for playlist “radio4” Radio 2: ssh connection made to issue the clear / load / play command for playlist “radio2” So I’m thinking a .sh script to take the argument passed via the URL and run the mpc commands. Just like the vol.sh. What do you reckon? RE: Extend URL API to clear / load / play a playlist - TheOldPresbyope - 02-06-2019 (02-06-2019, 04:22 PM)tristanc Wrote: I don’t think this is implemented currently, but I think it would be really useful to have a “play playlist x” URL. You can do volume and stop via URLs, but not play. @tristanc I reckon you should just do it. ![]() As you surmise, the basic machinery is there. Like vol.sh, you could create a /var/www/playitagainsam.sh script with appropriate options and invoke it via http://moode/command?cmd=playitagainsam.sh with appropriate parameters. (See Tim's recent reply to another poster http://moodeaudio.org/forum/showthread.php?tid=1059&pid=7698#pid7698) You'll likely have to reinstall the script after a moOde update. Regards, Kent RE: Extend URL API to clear / load / play a playlist - tristanc - 02-07-2019 (02-06-2019, 05:17 PM)TheOldPresbyope Wrote: I reckon you should just do it. Yep, easy as pi. A quick edit of vol.sh did it. Thanks! T RE: Extend URL API to clear / load / play a playlist - tristanc - 09-01-2019 (02-06-2019, 05:17 PM)TheOldPresbyope Wrote: As you surmise, the basic machinery is there. Just in case anyone needs this in the future - in v6 custom scripts can't be called via the URL like the above. You need to modify /var/www/command/index.php to include another elsif section to match the name of your script file. My version below: PHP Code: <?php |