Merge remote-tracking branch 'origin/dev'

This commit is contained in:
Flummi 2022-05-09 16:40:52 +02:00
commit 647991b5e9
2 changed files with 3 additions and 3 deletions

View File

@ -168,8 +168,6 @@ export default new class {
const res = JSON.parse(stdout.replace(/\'/g, '"').split('\n').slice(1, -1));
const tmp = Object.values(res)[0];
tmp.sexy = tmp.sexy / 2;
let nsfw = false;
if(tmp.neutral >= .7)
nsfw = false;

View File

@ -192,9 +192,11 @@ export default async bot => {
// autotagger
let tags = [];
let score = 0;
try {
if(mime.startsWith('image')) {
const res = await lib.detectNSFW(filename);
score = res.score;
await db`
insert into "tags_assign" ${
@ -241,7 +243,7 @@ export default async bot => {
}
e.reply([
`[f0cked] link: ${cfg.main.url.full}/${itemid} | size: ${lib.formatSize(size)} | speed: ${speed}` + (tags.length > 0 ? ` | tags: ${tags.join(', ')}` : '')
`[f0cked] link: ${cfg.main.url.full}/${itemid} | size: ${lib.formatSize(size)} | speed: ${speed}` + (tags.length > 0 ? ` | tags: ${tags.join(', ')} (score: ${score})` : '')
]);
});