Initial commit

This commit is contained in:
twotalesanimation
2026-06-11 10:46:09 +02:00
commit 81ad7e4ea9
223 changed files with 39530 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
// scripts/update-thumbnail-urls.ts
// Update all existing thumbnail URLs from /uploads/thumbnails/ to /api/thumbnails/
import { prisma } from "@/lib/prisma";
async function main() {
try {
console.log("Updating thumbnail URLs...");
const result = await prisma.$executeRawUnsafe(
`UPDATE "Video"
SET thumbnail = REPLACE(thumbnail, '/uploads/thumbnails/', '/api/thumbnails/')
WHERE thumbnail IS NOT NULL
AND thumbnail LIKE '/uploads/thumbnails/%'`
);
console.log(`✓ Updated ${result} video records`);
} catch (error) {
console.error("Error updating thumbnail URLs:", error);
process.exit(1);
} finally {
await prisma.$disconnect();
}
}
main();