Thank you for your donation!


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


Plexamp improvements
#3
Here's the code that manages Plexamp during moode startup. It's in /var/www/daemon/worker.php. 

Update the service file to reflect the userid and home directory.
Code:
// Start Plexamp renderer
if ($_SESSION['feat_bitmask'] & FEAT_PLEXAMP) {
    if ($_SESSION['plexamp_installed'] == 'yes') {
        sysCmd("sed -i '/User=/c \User=" . $_SESSION['user_id'] . "' /etc/systemd/system/plexamp.service");
        sysCmd("sed -i '/WorkingDirectory=/c \WorkingDirectory=/home/" . $_SESSION['user_id'] . "/plexamp' /etc/systemd/system/plexamp.service");
        sysCmd("sed -i '/ExecStart=/c \ExecStart=/usr/bin/node /home/" . $_SESSION['user_id'] . "/plexamp/js/index.js' /etc/systemd/system/plexamp.service");
        if (isset($_SESSION['pasvc']) && $_SESSION['pasvc'] == 1) {
            $status = 'started';
            startPlexamp();
        } else {
            $status = 'available';
        }
    } else {
        $status = 'not installed';
    }
} else {
    $status = 'n/a';
}

Your nice installer/updater script would make things much easier but it does some CLI prompting which isn't really WebUI friendly. Moode already has all the deps (I think) except for nodejs.

Could the script be adapted so it doesn't require user input?
What is jq?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Messages In This Thread
Plexamp improvements - by JimmyKing - 10-04-2024, 09:59 PM
RE: Plexamp improvements - by Tim Curtis - 10-04-2024, 10:41 PM
RE: Plexamp improvements - by Tim Curtis - 10-04-2024, 11:09 PM
RE: Plexamp improvements - by JimmyKing - 10-05-2024, 11:12 AM
RE: Plexamp improvements - by JimmyKing - 10-20-2024, 02:34 PM
RE: Plexamp improvements - by TheOldPresbyope - 10-20-2024, 04:25 PM
RE: Plexamp improvements - by Nutul - 10-20-2024, 05:46 PM

Forum Jump: