diff --git a/services/worker/src/workers/filmstrip.js b/services/worker/src/workers/filmstrip.js index d6fb0e2..02be55a 100644 --- a/services/worker/src/workers/filmstrip.js +++ b/services/worker/src/workers/filmstrip.js @@ -26,6 +26,18 @@ export const filmstripWorker = async (job) => { try { await mkdir(tmpDir, { recursive: true }); + // Check asset status before doing any work + const assetRow = await query( + 'SELECT status FROM assets WHERE id = $1', + [assetId] + ); + const asset = assetRow.rows[0]; + + if (asset?.status === 'pending_migration') { + console.log(`[filmstrip] asset ${assetId} is pending_migration, skipping`); + return; + } + // 1. Download proxy from S3 await job.updateProgress(5); console.log(`[filmstrip] Downloading ${proxyKey} for asset ${assetId}`); @@ -38,7 +50,7 @@ export const filmstripWorker = async (job) => { // 3. Extract FRAME_COUNT frames evenly spaced across the clip using FFmpeg // fps filter: select one frame every (duration / frameCount) seconds. - // select=not(mod(n\,step)) is less reliable than fps for variable-frame content. + // select=not(mod(n\\,step)) is less reliable than fps for variable-frame content. const interval = durationSec / FRAME_COUNT; const outputGlob = join(tmpDir, 'frame-%03d.jpg');