Skip to content

Commit

Permalink
[moodeutl] Add option to clear output dev cache
Browse files Browse the repository at this point in the history
  • Loading branch information
moodeaudio committed Apr 6, 2024
1 parent e7702ce commit 4c75fcf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions usr/local/bin/moodeutl
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ switch ($option) {
case '--btreset':
bluetoothReset();
break;
case '--odcclear':
outputDeviceCacheClear();
break;
case '--mpdlog':
printMPDLog();
break;
Expand Down Expand Up @@ -187,6 +190,7 @@ With no OPTION print the help text and exit.
-U\t\tCheck station urls, list only unplayable
--hwparams\tPrint ALSA hardware params
--btreset\tReset Bluetooth to off
--odcclear\tClear output device cache
--mpdlog\tPrint MPD log
--updlog\tPrint in-place update log
--mountmonlog\tPrint mount monitor log
Expand Down Expand Up @@ -534,6 +538,11 @@ function bluetoothReset() {
echo 'Bluetooth reset to off, reboot required' . "\n";
}

function outputDeviceCacheClear() {
shell_exec("sqlite3 " . SQLDB_PATH . " \"DELETE FROM cfg_outputdev\"");
echo 'Output device cache cleared' . "\n";
}

function printHWParams() {
$trxTx = trim(shell_exec('sqlite3 ' . SQLDB_PATH . " \"SELECT value FROM cfg_system WHERE param='multiroom_tx'\""));
if ($trxTx == 'On') {
Expand Down

0 comments on commit 4c75fcf

Please sign in to comment.