|
|
|
|
@ -117,6 +117,40 @@ server.get('/seek/:time', function (req, res, next) {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
server.get('/seekPercent/:percent', function (req, res, next) {
|
|
|
|
|
log.info("seekpercent "+req.params.percent);
|
|
|
|
|
writeCommand("seek", [req.params.percent, "absolute-percent"])
|
|
|
|
|
.then(function() {
|
|
|
|
|
res.send({"success":true});
|
|
|
|
|
return next(false);
|
|
|
|
|
}, function(reason) {
|
|
|
|
|
res.send({"success":false, "reason": reason});
|
|
|
|
|
return next(false);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
server.get('/seekChapter/:where', function (req, res, next) {
|
|
|
|
|
log.info("seekChapter "+req.params.where);
|
|
|
|
|
writeCommand("add", ["chapter", req.params.where])
|
|
|
|
|
.then(function() {
|
|
|
|
|
res.send({"success":true});
|
|
|
|
|
return next(false);
|
|
|
|
|
}, function(reason) {
|
|
|
|
|
res.send({"success":false, "reason": reason});
|
|
|
|
|
return next(false);
|
|
|
|
|
});
|
|
|
|
|
});server.get('/volume/:amount', function (req, res, next) {
|
|
|
|
|
log.info("volume "+req.params.amount);
|
|
|
|
|
writeCommand("add", ["volume", req.params.amount])
|
|
|
|
|
.then(function() {
|
|
|
|
|
res.send({"success":true});
|
|
|
|
|
return next(false);
|
|
|
|
|
}, function(reason) {
|
|
|
|
|
res.send({"success":false, "reason": reason});
|
|
|
|
|
return next(false);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
server.get('/volume/:amount', function (req, res, next) {
|
|
|
|
|
log.info("volume "+req.params.amount);
|
|
|
|
|
writeCommand("add", ["volume", req.params.amount])
|
|
|
|
|
|