02-24-2020, 07:09 PM
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