generate blur thumbnail for all items!

This commit is contained in:
2026-05-23 21:05:40 +02:00
parent 8c9e89c771
commit 2f044a8d02
11 changed files with 79 additions and 92 deletions

View File

@@ -406,10 +406,8 @@ export const handleUpload = async (req, res, self) => {
}
}
// Generate blurred thumbnail for NSFW/NSFL
if (effectiveRating === 'nsfw' || effectiveRating === 'nsfl') {
await queue.genBlurredThumbnail(itemid, isPending);
}
// Generate blurred thumbnail for all posts (SFW, NSFW, NSFL, Untagged)
await queue.genBlurredThumbnail(itemid, isPending);
// Insert optional first comment
if (comment && comment.length > 0) {
@@ -553,14 +551,12 @@ export const handleUpload = async (req, res, self) => {
console.error(`[BACKGROUND ERROR] genThumbnail failed for item ${itemid}:`, err);
}
// Ensure blurred thumbnail exists if needed
if (effectiveRating === 'nsfw' || effectiveRating === 'nsfl') {
const tDir = isPending ? path.join(cfg.paths.pending, 't') : cfg.paths.t;
const blurPath = path.join(tDir, `${itemid}_blur.webp`);
const blurExists = await fs.access(blurPath).then(() => true).catch(() => false);
if (!blurExists) {
await queue.genBlurredThumbnail(itemid, isPending).catch(err => console.error(`[BACKGROUND ERROR] genBlurredThumbnail failed:`, err));
}
// Ensure blurred thumbnail exists
const tDir = isPending ? path.join(cfg.paths.pending, 't') : cfg.paths.t;
const blurPath = path.join(tDir, `${itemid}_blur.webp`);
const blurExists = await fs.access(blurPath).then(() => true).catch(() => false);
if (!blurExists) {
await queue.genBlurredThumbnail(itemid, isPending).catch(err => console.error(`[BACKGROUND ERROR] genBlurredThumbnail failed:`, err));
}
// Note: video title metadata is surfaced to the user as a suggestion in the upload form.