master #50

Merged
schrumpel merged 101 commits from master into dev 2022-10-22 23:40:03 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 647991b5e9 - Show all commits

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})` : '')
]);
});