Don't count chapter for time saved

This commit is contained in:
Ajay
2022-07-04 01:10:52 -04:00
parent ebee00322a
commit cc953884d9
3 changed files with 3 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ export async function getTotalStats(req: Request, res: Response): Promise<void>
const userCountQuery = `(SELECT COUNT(*) FROM (SELECT DISTINCT "userID" from "sponsorTimes") t) "userCount",`;
const row = await db.prepare("get", `SELECT ${req.query.countContributingUsers ? userCountQuery : ""} COUNT(*) as "totalSubmissions",
SUM("views") as "viewCount", SUM(("endTime" - "startTime") / 60 * "views") as "minutesSaved" FROM "sponsorTimes" WHERE "shadowHidden" != 1 AND "votes" >= 0`, []);
SUM("views") as "viewCount", SUM(("endTime" - "startTime") / 60 * "views") as "minutesSaved" FROM "sponsorTimes" WHERE "shadowHidden" != 1 AND "votes" >= 0 AND "actionType" != 'chapter'`, []);
if (row !== undefined) {
const extensionUsers = chromeUsersCache + firefoxUsersCache;