deleted f0cks in ranking
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 36s
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 36s
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user