fixing thumbnail

This commit is contained in:
Kibi Kelburton 2023-04-05 23:14:23 +02:00
commit 5da67f2a6a
5 changed files with 53 additions and 32 deletions

32
package-lock.json generated
View File

@ -1,24 +1,24 @@
{ {
"name": "f0ckv2", "name": "f0ckv2",
"version": "2.2.0", "version": "2.2.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "f0ckv2", "name": "f0ckv2",
"version": "2.2.0", "version": "2.2.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"cuffeo": "^1.1.0", "cuffeo": "^1.2.1",
"flumm-fetch": "^1.0.1", "flumm-fetch": "^1.0.1",
"flummpress": "^2.0.5", "flummpress": "^2.0.5",
"postgres": "^3.0.1" "postgres": "^3.3.4"
} }
}, },
"node_modules/cuffeo": { "node_modules/cuffeo": {
"version": "1.1.0", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/cuffeo/-/cuffeo-1.1.0.tgz", "resolved": "https://registry.npmjs.org/cuffeo/-/cuffeo-1.2.1.tgz",
"integrity": "sha512-7lmx2dvREqCYwy8oUzk3Q0EkyLZkKQTYTBLEjNqKVbinzdEL45Oimi54lmBDFPlrrvTLzQkFvzKmiJ7Zcegi2w==", "integrity": "sha512-nQMrXj7xR4RWO6nS8Un4uFuiVSIzVOgvShEeJvWyEHnW38X9g+BicrY8Lc/lqcw6mmtsED6KuuOs9KHD3Y6oIA==",
"dependencies": { "dependencies": {
"flumm-fetch": "^1.0.1" "flumm-fetch": "^1.0.1"
} }
@ -34,9 +34,9 @@
"integrity": "sha512-C/8Im6OvoZw67q9DvYIXKjKr28zHYLJdH4DucQ6zpVbN1eWPySmxkJTURbkq3uEwABXLngXLifS6mjxAC++umQ==" "integrity": "sha512-C/8Im6OvoZw67q9DvYIXKjKr28zHYLJdH4DucQ6zpVbN1eWPySmxkJTURbkq3uEwABXLngXLifS6mjxAC++umQ=="
}, },
"node_modules/postgres": { "node_modules/postgres": {
"version": "3.1.0", "version": "3.3.4",
"resolved": "https://registry.npmjs.org/postgres/-/postgres-3.1.0.tgz", "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.3.4.tgz",
"integrity": "sha512-yQbJtA7z6SsQuFiF01rmHlkG2gU5IEv9D/Pn2fu8Tz6x3/suNWZs4fIPd59rkL+dfVfhDqYQ7DU3YnUqzEDB5Q==", "integrity": "sha512-XVu0+d/Y56pl2lSaf0c7V19AhAEfpVrhID1IENWN8nf0xch6hFq6dAov5dtUX6ZD46wfr1TxvLhxLtV8WnNsOg==",
"funding": { "funding": {
"type": "individual", "type": "individual",
"url": "https://github.com/sponsors/porsager" "url": "https://github.com/sponsors/porsager"
@ -45,9 +45,9 @@
}, },
"dependencies": { "dependencies": {
"cuffeo": { "cuffeo": {
"version": "1.1.0", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/cuffeo/-/cuffeo-1.1.0.tgz", "resolved": "https://registry.npmjs.org/cuffeo/-/cuffeo-1.2.1.tgz",
"integrity": "sha512-7lmx2dvREqCYwy8oUzk3Q0EkyLZkKQTYTBLEjNqKVbinzdEL45Oimi54lmBDFPlrrvTLzQkFvzKmiJ7Zcegi2w==", "integrity": "sha512-nQMrXj7xR4RWO6nS8Un4uFuiVSIzVOgvShEeJvWyEHnW38X9g+BicrY8Lc/lqcw6mmtsED6KuuOs9KHD3Y6oIA==",
"requires": { "requires": {
"flumm-fetch": "^1.0.1" "flumm-fetch": "^1.0.1"
} }
@ -63,9 +63,9 @@
"integrity": "sha512-C/8Im6OvoZw67q9DvYIXKjKr28zHYLJdH4DucQ6zpVbN1eWPySmxkJTURbkq3uEwABXLngXLifS6mjxAC++umQ==" "integrity": "sha512-C/8Im6OvoZw67q9DvYIXKjKr28zHYLJdH4DucQ6zpVbN1eWPySmxkJTURbkq3uEwABXLngXLifS6mjxAC++umQ=="
}, },
"postgres": { "postgres": {
"version": "3.1.0", "version": "3.3.4",
"resolved": "https://registry.npmjs.org/postgres/-/postgres-3.1.0.tgz", "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.3.4.tgz",
"integrity": "sha512-yQbJtA7z6SsQuFiF01rmHlkG2gU5IEv9D/Pn2fu8Tz6x3/suNWZs4fIPd59rkL+dfVfhDqYQ7DU3YnUqzEDB5Q==" "integrity": "sha512-XVu0+d/Y56pl2lSaf0c7V19AhAEfpVrhID1IENWN8nf0xch6hFq6dAov5dtUX6ZD46wfr1TxvLhxLtV8WnNsOg=="
} }
} }
} }

View File

@ -4,20 +4,20 @@
"description": "f0ck, kennste?", "description": "f0ck, kennste?",
"main": "index.mjs", "main": "index.mjs",
"scripts": { "scripts": {
"start": "node --experimental-json-modules src/index.mjs", "start": "node --trace-uncaught src/index.mjs",
"trigger": "node --experimental-json-modules debug/trigger.mjs", "trigger": "node debug/trigger.mjs",
"autotagger": "node --experimental-json-modules debug/autotagger.mjs", "autotagger": "node debug/autotagger.mjs",
"thumbnailer": "node --experimental-json-modules debug/thumbnailer.mjs", "thumbnailer": "node debug/thumbnailer.mjs",
"test": "node --experimental-json-modules debug/test.mjs", "test": "node debug/test.mjs",
"clean": "node --experimental-json-modules debug/clean.mjs", "clean": "node debug/clean.mjs",
"adduser": "node --experimental-json-modules debug/adduser.mjs" "adduser": "node debug/adduser.mjs"
}, },
"author": "Flummi", "author": "Flummi",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"cuffeo": "^1.1.0", "cuffeo": "^1.2.1",
"flumm-fetch": "^1.0.1", "flumm-fetch": "^1.0.1",
"flummpress": "^2.0.5", "flummpress": "^2.0.5",
"postgres": "^3.0.1" "postgres": "^3.3.4"
} }
} }

View File

@ -1136,9 +1136,9 @@ body {
line-height: 2; line-height: 2;
scrollbar-color: var(--scrollbar-color) transparent; scrollbar-color: var(--scrollbar-color) transparent;
scrollbar-width: thin; scrollbar-width: thin;
overscroll-behavior-y: contain;
overflow: unset;
font-size: 14px; font-size: 14px;
overflow: hidden;
height: 100%;
} }
.wrapper { .wrapper {
@ -1247,6 +1247,8 @@ div.posts>a:hover::after {
} }
.navbar { .navbar {
position: sticky;
top: 0;
padding: 0; padding: 0;
width: 100%; width: 100%;
z-index: 3; z-index: 3;
@ -2796,8 +2798,3 @@ ul.navbar-nav-guests li.nav-item {
background: #00000036; background: #00000036;
} }
} }
#main {
overflow: auto;
height: calc(100%);
}

View File

@ -10,6 +10,7 @@ export default async bot => {
active: false, active: false,
f: async e => { f: async e => {
let args = e.args.slice(1); let args = e.args.slice(1);
/*let rows = sql("items").select("id", "username", "mime", "size"); /*let rows = sql("items").select("id", "username", "mime", "size");
for(let i = 0; i < args.length; i++) { for(let i = 0; i < args.length; i++) {
@ -21,6 +22,26 @@ export default async bot => {
rows = await rows.orderByRaw("random()").limit(1);*/ rows = await rows.orderByRaw("random()").limit(1);*/
const rows = await db`
select id, mime, username, size
from "items"
where
${ args.map(a => a.charAt(0) === "!"
? db`username not ilike ${a.slice(1)}`
: db`username ilike ${a}`
).join(' and ')}
order by random()
`;
console.log(`select id, mime, username, size
from "items"
where
${ args.map(a => a.charAt(0) === "!"
? `username not ilike ${a.slice(1)}`
: `username ilike ${a}`
).join(' and ')}
order by random()`);
if(rows.length === 0) if(rows.length === 0)
return e.reply("nothing found, f0cker"); return e.reply("nothing found, f0cker");

View File

@ -97,6 +97,9 @@
@endif @endif
</span> </span>
</div> </div>
<div class="random">
<a href="/random"></a>
</div>
</div> </div>
@include(snippets/footer) @include(snippets/footer)
</div> </div>