This commit is contained in:
parent
e47dfb38fb
commit
63bd1104b7
|
@ -84,36 +84,41 @@ export default new class {
|
|||
|
||||
// async funcs
|
||||
async countf0cks() {
|
||||
const tagged = (await db`
|
||||
const tagged = +(await db`
|
||||
select count(*) as total
|
||||
from "items"
|
||||
where id in (select item_id from tags_assign group by item_id) and active = true
|
||||
`)[0].total;
|
||||
const untagged = (await db`
|
||||
const untagged = +(await db`
|
||||
select count(*) as total
|
||||
from "items"
|
||||
where id not in (select item_id from tags_assign group by item_id) and active = true
|
||||
`)[0].total;
|
||||
const sfw = (await db`
|
||||
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) and active = true
|
||||
`)[0].total;
|
||||
const nsfw = (await db`
|
||||
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) and active = true
|
||||
`)[0].total;
|
||||
const deleted = (await db`
|
||||
const deleted = +(await db`
|
||||
select count(*) as total
|
||||
from "items"
|
||||
where active = false
|
||||
`)[0].total;
|
||||
const lastf0ck = +(await db`
|
||||
select max(id) as id
|
||||
from "items"
|
||||
`)[0].id;
|
||||
return {
|
||||
tagged,
|
||||
untagged,
|
||||
total: +tagged + +untagged,
|
||||
total: tagged + untagged,
|
||||
deleted,
|
||||
untracked: lastf0ck - (tagged + untagged + deleted),
|
||||
sfw,
|
||||
nsfw,
|
||||
};
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
<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>
|
||||
<tr><td>missing ids</td><td>{{ stats.untracked }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user