|
|
|
|
@ -119,7 +119,7 @@ server.get('/seek/:time', function (req, res, next) {
|
|
|
|
|
|
|
|
|
|
server.get('/volume/:amount', function (req, res, next) {
|
|
|
|
|
log.info("volume "+req.params.amount);
|
|
|
|
|
writeCommand("", [req.params.amount])
|
|
|
|
|
writeCommand("add", ["volume", req.params.amount])
|
|
|
|
|
.then(function() {
|
|
|
|
|
res.send({"success":true});
|
|
|
|
|
return next(false);
|
|
|
|
|
@ -129,6 +129,29 @@ server.get('/volume/:amount', function (req, res, next) {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
server.get('/playpause', function (req, res, next) {
|
|
|
|
|
log.info("playpause ");
|
|
|
|
|
writeCommand("cycle", ["pause"])
|
|
|
|
|
.then(function() {
|
|
|
|
|
res.send({"success":true});
|
|
|
|
|
return next(false);
|
|
|
|
|
}, function(reason) {
|
|
|
|
|
res.send({"success":false, "reason": reason});
|
|
|
|
|
return next(false);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
server.get('/muteunmute', function (req, res, next) {
|
|
|
|
|
log.info("muteunmute ");
|
|
|
|
|
writeCommand("cycle", ["mute"])
|
|
|
|
|
.then(function() {
|
|
|
|
|
res.send({"success":true});
|
|
|
|
|
return next(false);
|
|
|
|
|
}, function(reason) {
|
|
|
|
|
res.send({"success":false, "reason": reason});
|
|
|
|
|
return next(false);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
server.listen(8080, function() {
|
|
|
|
|
console.log('%s listening at %s', server.name, server.url);
|
|
|
|
|
|