deleted f0cks in ranking
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 36s

This commit is contained in:
Flummi 2023-05-03 04:08:59 +02:00
parent cea4a13b4c
commit e47dfb38fb
2 changed files with 12 additions and 5 deletions

View File

@ -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) {

View File

@ -34,6 +34,7 @@
<tr><td>untagged</td><td>{{ stats.untagged }}</td></tr>
<tr><td>SFW</td><td>{{ stats.sfw }}</td></tr>
<tr><td>NSFW</td><td>{{ stats.nsfw }}</td></tr>
<tr><td>deleted</td><td>{{ stats.deleted }}</td></tr>
</table>
</div>
</div>