From 4e45e0fd66735f11c70b9943ee76b98897fb2626 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Mon, 8 Jun 2026 20:05:04 +0200 Subject: [PATCH] turn splash screen back on and fix regen script --- public/s/js/f0ckm.js | 4 ++-- scripts/regen.mjs | 27 +++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index 50715b9..4127e54 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -1659,7 +1659,7 @@ window.cancelAnimFrame = (function () { "letterbox": "on", "warnOnUnsupportedContent": false, "contextMenu": "on", - "splashScreen": false + "splashScreen": true }; let ruffleKeepAliveApplied = false; @@ -1768,7 +1768,7 @@ window.cancelAnimFrame = (function () { "autoplay": blurActive ? "off" : "on", "pageVisibility": window.f0ckSession?.ruffle_background === false, "backgroundExecution": window.f0ckSession?.ruffle_background === false ? undefined : "Unthrottled", - "splashScreen": false + "splashScreen": true }; } diff --git a/scripts/regen.mjs b/scripts/regen.mjs index bb3cf5f..0818e1c 100644 --- a/scripts/regen.mjs +++ b/scripts/regen.mjs @@ -9,6 +9,9 @@ * node regen.mjs --audio - Regenerate all audio items * node regen.mjs --pdf - Regenerate all PDF items * node regen.mjs --blur - Regenerate ONLY the blurred thumbnails for all items + * + * Flash (SWF) items are always excluded — their thumbnails are set via the + * Ruffle snapshot mechanism and must never be touched by this script. */ import db from "../src/inc/sql.mjs"; @@ -31,6 +34,13 @@ if (args.length === 0) { process.exit(0); } +// Flash mime types — never regenerate these +const FLASH_MIMES = [ + 'application/x-shockwave-flash', + 'application/vnd.adobe.flash.movie', +]; +const isFlash = (mime) => FLASH_MIMES.includes(mime?.toLowerCase()); + const THUMB_SIZE = 512; const blurOnly = args.includes('--blur'); console.log(`[regen] Thumb size: ${THUMB_SIZE}px\n`); @@ -38,6 +48,11 @@ console.log(`[regen] Thumb size: ${THUMB_SIZE}px\n`); const regen = async (item) => { const { id, dest, mime, src } = item; + if (isFlash(mime)) { + console.log(`[${id}] Skipped (Flash/SWF — thumbnail managed by Ruffle snapshot)`); + return; + } + if (blurOnly) { console.log(`[${id}] Regenerating blurred thumbnail only: ${dest}`); try { @@ -72,12 +87,15 @@ const regen = async (item) => { } }; +// Shared NOT IN clause for Flash exclusion +const flashExclude = db`mime NOT IN (${db(FLASH_MIMES)})`; + try { let items; if (args.includes('--all')) { - items = await db`SELECT id, dest, mime, src FROM items WHERE active = true AND is_deleted = false ORDER BY id`; - console.log(`Regenerating ALL ${items.length} items...\n`); + items = await db`SELECT id, dest, mime, src FROM items WHERE active = true AND is_deleted = false AND ${flashExclude} ORDER BY id`; + console.log(`Regenerating ALL ${items.length} non-Flash items...\n`); } else if (args.includes('--audio')) { items = await db`SELECT id, dest, mime, src FROM items WHERE active = true AND is_deleted = false AND mime ILIKE 'audio/%' ORDER BY id`; console.log(`Regenerating ${items.length} audio items...\n`); @@ -91,10 +109,10 @@ try { items = await db` SELECT id, dest, mime, src FROM items - WHERE active = true AND is_deleted = false + WHERE active = true AND is_deleted = false AND ${flashExclude} ORDER BY id `; - console.log(`Regenerating ONLY blurred thumbnails for all ${items.length} items...\n`); + console.log(`Regenerating ONLY blurred thumbnails for all ${items.length} non-Flash items...\n`); } else { const ids = args.map(Number).filter(n => !isNaN(n) && n > 0); if (ids.length === 0) { @@ -117,3 +135,4 @@ try { console.error('Fatal error:', err); process.exit(1); } +