From 167d9ad009478292d97cb5ab5280287a9f3c08ff Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Tue, 2 Jun 2026 18:38:24 -0400 Subject: [PATCH] =?UTF-8?q?feat/fix:=20filmstrip.js=20=E2=80=94=20growing?= =?UTF-8?q?=20migrate=20flow=20+=20deltacast=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/worker/src/workers/filmstrip.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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');