Skip to content

Commit

Permalink
Merge pull request #5 from imgrant/service-fixes
Browse files Browse the repository at this point in the history
Beocreate service call fixes
  • Loading branch information
TonyTromp committed Feb 3, 2022
2 parents adb04c2 + 68b7e30 commit 3c4a9f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions beocreate/beo-extensions/tidal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,22 @@ var fs = require("fs");

function settidalStatus(enabled, callback) {
if (enabled) {
exec("systemctl start --now tidal.service").on('exit', function(code) {
exec("systemctl enable --now tidal.service").on('exit', function(code) {
if (code == 0) {
settings.tidalEnabled = true;
if (debug) console.log("Roon enabled.");
if (debug) console.log("TIDAL Connect enabled.");
callback(true);
} else {
roonEnabled = false;
settings.tidalEnabled = false;
callback(false, true);
}
});
} else {
exec("systemctl stop --now tidal.service").on('exit', function(code) {
exec("systemctl disable --now tidal.service").on('exit', function(code) {
settings.tidalEnabled = false;
if (code == 0) {
callback(false);
if (debug) console.log("Roon disabled.");
if (debug) console.log("TIDAL Connect disabled.");
} else {
callback(false, true);
}
Expand Down

0 comments on commit 3c4a9f2

Please sign in to comment.