better blur

This commit is contained in:
2026-05-23 15:29:50 +02:00
parent 4b50e56eb8
commit 97cc69b337
3 changed files with 35 additions and 9 deletions

View File

@@ -14598,7 +14598,7 @@ body.scroller-active #gchat-reopen-bubble {
font-size: 14px !important; font-size: 14px !important;
letter-spacing: 2px !important; letter-spacing: 2px !important;
text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important;
background: rgba(15, 15, 20, 0.5) !important; background: rgba(10, 10, 12, 0.65) !important;
pointer-events: none !important; pointer-events: none !important;
opacity: 1 !important; opacity: 1 !important;
transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important; transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important;
@@ -14617,7 +14617,7 @@ body.scroller-active #gchat-reopen-bubble {
font-size: 14px !important; font-size: 14px !important;
letter-spacing: 2px !important; letter-spacing: 2px !important;
text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important;
background: rgba(15, 15, 20, 0.6) !important; background: rgba(10, 10, 12, 0.75) !important;
pointer-events: none !important; pointer-events: none !important;
opacity: 1 !important; opacity: 1 !important;
transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important; transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important;
@@ -14636,9 +14636,9 @@ body.scroller-active #gchat-reopen-bubble {
font-size: 14px !important; font-size: 14px !important;
letter-spacing: 2px !important; letter-spacing: 2px !important;
text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important;
background: rgba(15, 15, 20, 0.45) !important; background: rgba(10, 10, 12, 0.6) !important;
backdrop-filter: blur(15px) !important; backdrop-filter: blur(28px) !important;
-webkit-backdrop-filter: blur(15px) !important; -webkit-backdrop-filter: blur(28px) !important;
pointer-events: none !important; pointer-events: none !important;
opacity: 1 !important; opacity: 1 !important;
transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important; transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important;
@@ -14657,9 +14657,9 @@ body.scroller-active #gchat-reopen-bubble {
font-size: 14px !important; font-size: 14px !important;
letter-spacing: 2px !important; letter-spacing: 2px !important;
text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important;
background: rgba(15, 15, 20, 0.5) !important; background: rgba(10, 10, 12, 0.65) !important;
backdrop-filter: blur(18px) !important; backdrop-filter: blur(32px) !important;
-webkit-backdrop-filter: blur(18px) !important; -webkit-backdrop-filter: blur(32px) !important;
pointer-events: none !important; pointer-events: none !important;
opacity: 1 !important; opacity: 1 !important;
transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important; transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important;

View File

@@ -8,6 +8,7 @@
* node regen.mjs --all - Regenerate ALL items * node regen.mjs --all - Regenerate ALL items
* node regen.mjs --audio - Regenerate all audio items * node regen.mjs --audio - Regenerate all audio items
* node regen.mjs --pdf - Regenerate all PDF items * node regen.mjs --pdf - Regenerate all PDF items
* node regen.mjs --blur - Regenerate ONLY the blurred thumbnails for NSFW/NSFL items
*/ */
import db from "../src/inc/sql.mjs"; import db from "../src/inc/sql.mjs";
@@ -26,14 +27,28 @@ if (args.length === 0) {
console.log(' node regen.mjs --audio - Regenerate all audio items'); console.log(' node regen.mjs --audio - Regenerate all audio items');
console.log(' node regen.mjs --pdf - Regenerate all PDF items'); console.log(' node regen.mjs --pdf - Regenerate all PDF items');
console.log(' node regen.mjs --youtube - Regenerate all YouTube thumbnails'); console.log(' node regen.mjs --youtube - Regenerate all YouTube thumbnails');
console.log(' node regen.mjs --blur - Regenerate ONLY the blurred thumbnails for NSFW/NSFL items');
process.exit(0); process.exit(0);
} }
const THUMB_SIZE = 512; const THUMB_SIZE = 512;
const blurOnly = args.includes('--blur');
console.log(`[regen] Thumb size: ${THUMB_SIZE}px\n`); console.log(`[regen] Thumb size: ${THUMB_SIZE}px\n`);
const regen = async (item) => { const regen = async (item) => {
const { id, dest, mime, src } = item; const { id, dest, mime, src } = item;
if (blurOnly) {
console.log(`[${id}] Regenerating blurred thumbnail only: ${dest}`);
try {
await queue.genBlurredThumbnail(id, false);
console.log(`[${id}] ✓ Blurred thumbnail regenerated`);
} catch (err) {
console.error(`[${id}] ✗ FAILED:`, err.message || err);
}
return;
}
console.log(`[${id}] Regenerating: ${dest} (${mime})`); console.log(`[${id}] Regenerating: ${dest} (${mime})`);
try { try {
@@ -75,6 +90,17 @@ try {
} else if (args.includes('--youtube')) { } else if (args.includes('--youtube')) {
items = await db`SELECT id, dest, mime, src FROM items WHERE active = true AND is_deleted = false AND mime = 'video/youtube' ORDER BY id`; items = await db`SELECT id, dest, mime, src FROM items WHERE active = true AND is_deleted = false AND mime = 'video/youtube' ORDER BY id`;
console.log(`Regenerating ${items.length} YouTube items...\n`); console.log(`Regenerating ${items.length} YouTube items...\n`);
} else if (blurOnly) {
const nsflTagId = cfg.nsfl_tag_id || 3;
items = await db`
SELECT DISTINCT i.id, i.dest, i.mime, i.src
FROM items i
JOIN tags_assign ta ON ta.item_id = i.id
WHERE i.active = true AND i.is_deleted = false
AND ta.tag_id IN (2, ${nsflTagId})
ORDER BY i.id
`;
console.log(`Regenerating ONLY blurred thumbnails for ${items.length} NSFW/NSFL items...\n`);
} else { } else {
const ids = args.map(Number).filter(n => !isNaN(n) && n > 0); const ids = args.map(Number).filter(n => !isNaN(n) && n > 0);
if (ids.length === 0) { if (ids.length === 0) {

View File

@@ -497,7 +497,7 @@ export default new class queue {
const src = path.join(tDir, `${itemid}.webp`); const src = path.join(tDir, `${itemid}.webp`);
const dst = path.join(tDir, `${itemid}_blur.webp`); const dst = path.join(tDir, `${itemid}_blur.webp`);
try { try {
await this.spawn('magick', [src, '-blur', '0x20', dst]); await this.spawn('magick', [src, '-blur', '0x48', dst]);
return true; return true;
} catch (err) { } catch (err) {
console.error(`[QUEUE] Failed to generate blurred thumbnail for ${itemid}:`, err); console.error(`[QUEUE] Failed to generate blurred thumbnail for ${itemid}:`, err);