Add GIF regeneration and diagnostic scripts
Added utility scripts for GIF management: 1. regenerate-all-gifs.ts: - Regenerates GIF previews for all existing videos - Deletes old GIFs before creating new ones - Provides progress feedback and summary statistics - Useful for bulk GIF generation after deployment 2. check-gifs.ts: - Quick diagnostic to list all GIF records in database - Shows term names and GIF URLs - Useful for verifying GIF generation 3. insert-gif-test.ts: - Test script to verify GIF enum value works in database - Creates, verifies, and cleans up test GIF record - Includes Prisma query logging for debugging Usage: cd packages/backend npx tsx scripts/regenerate-all-gifs.ts npx tsx scripts/check-gifs.ts npx tsx scripts/insert-gif-test.ts Co-Authored-By: Auggie
This commit is contained in:
20
packages/backend/scripts/check-gifs.ts
Normal file
20
packages/backend/scripts/check-gifs.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function checkGifs() {
|
||||
const gifs = await prisma.termMedia.findMany({
|
||||
where: { kind: 'GIF' },
|
||||
include: { term: true },
|
||||
});
|
||||
|
||||
console.log(`Found ${gifs.length} GIF records in database:`);
|
||||
gifs.forEach(gif => {
|
||||
console.log(`- ${gif.term.wordText}: ${gif.url}`);
|
||||
});
|
||||
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
|
||||
checkGifs();
|
||||
|
||||
Reference in New Issue
Block a user