mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-10 05:27:00 +03:00
Initial refactor (routes and utils to respective folders)
This commit is contained in:
12
src/routes/getDaysSavedFormatted.js
Normal file
12
src/routes/getDaysSavedFormatted.js
Normal file
@@ -0,0 +1,12 @@
|
||||
var db = require('../databases/databases.js');
|
||||
|
||||
module.exports = function getDaysSavedFormatted (req, res) {
|
||||
let row = db.prepare("select sum((endtime - starttime) / 60 / 60 / 24 * views) as dayssaved from sponsortimes where shadowhidden != 1").get();
|
||||
|
||||
if (row !== undefined) {
|
||||
//send this result
|
||||
res.send({
|
||||
dayssaved: row.dayssaved.tofixed(2)
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user