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 }}