From e47dfb38fb6cd3b439128851ef1e1520ad2eba55 Mon Sep 17 00:00:00 2001 From: Flummi Date: Wed, 3 May 2023 04:08:59 +0200 Subject: [PATCH] deleted f0cks in ranking --- src/inc/lib.mjs | 16 +++++++++++----- views/ranking.html | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/inc/lib.mjs b/src/inc/lib.mjs index 3892696..d8f5714 100644 --- a/src/inc/lib.mjs +++ b/src/inc/lib.mjs @@ -87,29 +87,35 @@ export default new class { const tagged = (await db` select count(*) as total from "items" - where id in (select item_id from tags_assign group by item_id) + where id in (select item_id from tags_assign group by item_id) and active = true `)[0].total; const untagged = (await db` select count(*) as total from "items" - where id not in (select item_id from tags_assign group by item_id) + where id not in (select item_id from tags_assign group by item_id) and active = true `)[0].total; const sfw = (await db` select count(*) as total from "items" - where id in (select item_id from tags_assign where tag_id = 1 group by item_id) + where id in (select item_id from tags_assign where tag_id = 1 group by item_id) and active = true `)[0].total; const nsfw = (await db` select count(*) as total from "items" - where id in (select item_id from tags_assign where tag_id = 2 group by item_id) + where id in (select item_id from tags_assign where tag_id = 2 group by item_id) and active = true + `)[0].total; + const deleted = (await db` + select count(*) as total + from "items" + where active = false `)[0].total; return { tagged, untagged, total: +tagged + +untagged, + deleted, sfw, - nsfw + nsfw, }; }; async hash(str) { diff --git a/views/ranking.html b/views/ranking.html index a8af8cb..bfddb92 100644 --- a/views/ranking.html +++ b/views/ranking.html @@ -34,6 +34,7 @@ untagged{{ stats.untagged }} SFW{{ stats.sfw }} NSFW{{ stats.nsfw }} + deleted{{ stats.deleted }}