turn splash screen back on and fix regen script
This commit is contained in:
@@ -1659,7 +1659,7 @@ window.cancelAnimFrame = (function () {
|
|||||||
"letterbox": "on",
|
"letterbox": "on",
|
||||||
"warnOnUnsupportedContent": false,
|
"warnOnUnsupportedContent": false,
|
||||||
"contextMenu": "on",
|
"contextMenu": "on",
|
||||||
"splashScreen": false
|
"splashScreen": true
|
||||||
};
|
};
|
||||||
|
|
||||||
let ruffleKeepAliveApplied = false;
|
let ruffleKeepAliveApplied = false;
|
||||||
@@ -1768,7 +1768,7 @@ window.cancelAnimFrame = (function () {
|
|||||||
"autoplay": blurActive ? "off" : "on",
|
"autoplay": blurActive ? "off" : "on",
|
||||||
"pageVisibility": window.f0ckSession?.ruffle_background === false,
|
"pageVisibility": window.f0ckSession?.ruffle_background === false,
|
||||||
"backgroundExecution": window.f0ckSession?.ruffle_background === false ? undefined : "Unthrottled",
|
"backgroundExecution": window.f0ckSession?.ruffle_background === false ? undefined : "Unthrottled",
|
||||||
"splashScreen": false
|
"splashScreen": true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
* 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 all 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";
|
import db from "../src/inc/sql.mjs";
|
||||||
@@ -31,6 +34,13 @@ if (args.length === 0) {
|
|||||||
process.exit(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 THUMB_SIZE = 512;
|
||||||
const blurOnly = args.includes('--blur');
|
const blurOnly = args.includes('--blur');
|
||||||
console.log(`[regen] Thumb size: ${THUMB_SIZE}px\n`);
|
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 regen = async (item) => {
|
||||||
const { id, dest, mime, src } = item;
|
const { id, dest, mime, src } = item;
|
||||||
|
|
||||||
|
if (isFlash(mime)) {
|
||||||
|
console.log(`[${id}] Skipped (Flash/SWF — thumbnail managed by Ruffle snapshot)`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (blurOnly) {
|
if (blurOnly) {
|
||||||
console.log(`[${id}] Regenerating blurred thumbnail only: ${dest}`);
|
console.log(`[${id}] Regenerating blurred thumbnail only: ${dest}`);
|
||||||
try {
|
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 {
|
try {
|
||||||
let items;
|
let items;
|
||||||
|
|
||||||
if (args.includes('--all')) {
|
if (args.includes('--all')) {
|
||||||
items = await db`SELECT id, dest, mime, src FROM items WHERE active = true AND is_deleted = false ORDER BY id`;
|
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} items...\n`);
|
console.log(`Regenerating ALL ${items.length} non-Flash items...\n`);
|
||||||
} else if (args.includes('--audio')) {
|
} 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`;
|
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`);
|
console.log(`Regenerating ${items.length} audio items...\n`);
|
||||||
@@ -91,10 +109,10 @@ try {
|
|||||||
items = await db`
|
items = await db`
|
||||||
SELECT id, dest, mime, src
|
SELECT id, dest, mime, src
|
||||||
FROM items
|
FROM items
|
||||||
WHERE active = true AND is_deleted = false
|
WHERE active = true AND is_deleted = false AND ${flashExclude}
|
||||||
ORDER BY id
|
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 {
|
} 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) {
|
||||||
@@ -117,3 +135,4 @@ try {
|
|||||||
console.error('Fatal error:', err);
|
console.error('Fatal error:', err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user