mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-14 15:37:07 +03:00
consistent return and sendStatus
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import {db} from '../databases/databases';
|
||||
import {Request, Response} from 'express';
|
||||
|
||||
export async function getDaysSavedFormatted(req: Request, res: Response): Promise<void> {
|
||||
export async function getDaysSavedFormatted(req: Request, res: Response): Promise<Response> {
|
||||
const row = await db.prepare('get', 'SELECT SUM(("endTime" - "startTime") / 60 / 60 / 24 * "views") as "daysSaved" from "sponsorTimes" where "shadowHidden" != 1', []);
|
||||
|
||||
if (row !== undefined) {
|
||||
//send this result
|
||||
res.send({
|
||||
return res.send({
|
||||
daysSaved: row.daysSaved.toFixed(2),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user