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:
parent
cea4a13b4c
commit
e47dfb38fb
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user