Thank you for your donation!


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


Trouble with REST command
#3
(04-04-2024, 11:33 AM)Tim Curtis Wrote: There is no alternative in r839 because the command was inadvertently left out when REST was refactored.

You can edit the file /var/www/command/index.php and add the case 'restart_renderer' code block. Then use http://moode/command/?cmd=restart_renderer --spotify

Code:
    case 'libupd-submit.php':    // DEPRECATED: not used via http
        $result = sysCmd('/var/www/util/libupd-submit.php');
        echo 'Library update submitted';
        break;
    case 'restart_renderer':     // --bluetooth | --airplay | --spotify | --squeezelite | --roonbridge
        $result = sysCmd('/var/www/util/restart-renderer.php ' . getArgs($cmd));
        echo (empty($result) ? 'OK' : 'Missing or invalid argument');
        break;
    default: // MPD commands
        if (false === ($sock = openMpdSock('localhost', 6600))) {
            debugLog('command/index.php: Connection to MPD failed');
        } else {
            sendMpdCmd($sock, $_GET['cmd']);
            $resp = readMpdResp($sock);
            closeMpdSock($sock);
            echo json_encode(parseMpdRespAsJSON($resp), JSON_FORCE_OBJECT);
        }

Thanks Tim, that worked nicely.

 Smile
Reply


Messages In This Thread
Trouble with REST command - by Furbo - 04-04-2024, 09:54 AM
RE: Trouble with REST command - by Tim Curtis - 04-04-2024, 11:33 AM
RE: Trouble with REST command - by Furbo - 04-05-2024, 03:44 PM

Forum Jump: