This commit is contained in:
2026-08-22 02:14:22 +02:00
parent 162a6bc0fc
commit 9377f05454
2 changed files with 40 additions and 0 deletions
+19
View File
@@ -406,6 +406,25 @@ export const handleUpload = async (req, res, self) => {
}
}
if (!manualApproval) {
f0cklib.clearCountCache();
try {
await db`SELECT pg_notify('new_item', ${JSON.stringify({
id: itemid,
dest: filename,
mime: 'video/youtube',
username: req.session.user,
display_name: req.session.display_name || null,
tag_id: effectiveRating ? (effectiveRating === 'sfw' ? 1 : (effectiveRating === 'nsfw' ? 2 : (cfg.nsfl_tag_id || 3))) : 0,
is_oc: !!is_oc,
slug: itemSlug,
visibility: targetVisibility
})})`;
} catch (err) {
console.error('[UPLOAD] YouTube new_item notify failed:', err);
}
}
const itemRoute = itemSlug ? `/${itemSlug}` : `/${itemid}`;
const successMsg = manualApproval ? 'Upload successful! Your upload is pending admin approval.' : 'Upload successful! Your upload is now live.';
return sendJson(res, {