master #50
@ -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;
|
||||
|
@ -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})` : '')
|
||||
]);
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user