Merge pull request 'master' (#50) from master into dev

Reviewed-on: #50
This commit is contained in:
Kibi Kelburton 2022-10-23 01:40:03 +02:00
commit 79441cf69a
3 changed files with 18 additions and 3 deletions

View File

@ -1652,6 +1652,7 @@ span.placeholder {
.imageDoor img {
background: var(--accent);
width: inherit;
}
._204863 {
@ -2558,3 +2559,13 @@ table img {
position: absolute;
z-index: 999;
}
/* Fix for navbar on mobile devices */
@media (max-width: 768px) {
.navbar-nav {
display: grid !important;
grid-template-rows: 1fr 1fr;
grid-template-columns: 0fr 1fr 1fr;
grid-gap: 0.25em;
}
}

View File

@ -162,6 +162,7 @@ export default new class {
return tags;
};
async detectNSFW(dest) {
return false;
const { stdout, stderr } = await exec(
`python -c "import sys\nfrom nsfw_detector import predict\nmodel = predict.load_model('./nsfw_model.h5')\nprint(predict.classify(model, './public/b/${dest}'))"`
);

View File

@ -191,7 +191,7 @@ export default async bot => {
speed = !Number.isFinite(speed) ? "yes" : `${speed.toFixed(2)} Mbit/s`;
// autotagger
let tags = [];
/*let tags = [];
let score = 0;
try {
if(mime.startsWith('image')) {
@ -240,10 +240,13 @@ export default async bot => {
}
} catch(err) {
console.error(err);
}
}*/
e.reply([
/*e.reply([
`[f0cked] link: ${cfg.main.url.full}/${itemid} | size: ${lib.formatSize(size)} | speed: ${speed}` + (tags.length > 0 ? ` | tags: ${tags.join(', ')} (score: ${score.toFixed(2)})` : '')
]);*/
e.reply([
`[f0cked] link: ${cfg.main.url.full}/${itemid} | size: ${lib.formatSize(size)} | speed: ${speed}`
]);
});