Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


[Moode 6.4.2] Report result of mpc commands to local UI
#2
I found a solution for the random play button. I wrote the following script and affect it to a button of my remote.

Code:
#!/bin/bash
SQLDB=/var/local/www/db/moode-sqlite3.db

RESULT=$(sqlite3 $SQLDB "select value from cfg_system where param='ashuffle'")

if [[ $RESULT == '1' ]]; then
   # ashuffle (random play) to ON set to 0 (OFF)
    $(sqlite3 $SQLDB "update cfg_system set value='0' where param='ashuffle'")
    /usr/bin/mpc consume OFF
else
   # ashuffle (random play) to OFF set to 1 (ON)
    $(sqlite3 $SQLDB "update cfg_system set value='1' where param='ashuffle'")
    /usr/bin/mpc consume ON
fi

exit 0
Reply


Messages In This Thread
RE: [Moode 6.4.2] Report result of mpc commands to local UI - by zebons - 02-24-2020, 07:09 PM

Forum Jump: