feat(pipeline): render-derived shot thumbnails, and bulk shot delete
Deploy / deploy (push) Failing after 19m11s
Deploy / deploy (push) Failing after 19m11s
Two independent features landing together: Generated shot thumbnails — a shot can now carry a thumbnail promoted from a render export (Shot.generatedThumbnailUrl/generatedThumbnailFrom) alongside the existing brief-supplied thumbnailUrl, which always takes display precedence (lib/shot-thumbnail.ts) so a promoted frame can only ever fill a gap, never overwrite the brief. Shows with pipelineConfig.autoShotThumbnail promote automatically on every finished export (lib/render-pipeline/preview.ts); promoteExportThumbnail/ clearGeneratedThumbnail (actions/shots.ts) are the manual equivalent for everyone else. Worker-side seek logic for picking the promoted frame is covered by RenderWorker/VFXReviewWorker.Tests/ThumbnailSeekTests.cs. Bulk shot delete — the shot-status page's selection bar gets a "Bulk Actions" dropdown (alongside the existing Change Due Date) with Delete Shots. bulkDeleteShots() (actions/shots.ts) deletes one at a time rather than in a single statement: exports_shotId_fkey is ON DELETE RESTRICT by design, so a shot with renders or deliveries on record is protected and gets skipped and reported by name rather than aborting the whole selection or being silently destroyed along with its history. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import { db } from "@/lib/db";
|
||||
import { PipelineError } from "./errors";
|
||||
import { applyTransition } from "./transitions";
|
||||
import { getConfigNumber, getPreviewConfig } from "./config";
|
||||
import { resolveProjectTemplates } from "./project-templates";
|
||||
import { resolveProjectTemplates, autoShotThumbnailEnabled } from "./project-templates";
|
||||
|
||||
/** Slate date format used by the panel's getDateString (YYYY/MM/DD). */
|
||||
function slateDate(d = new Date()): string {
|
||||
@@ -407,6 +407,30 @@ export async function finalizePreview(jobId: string, machineId: string, body: Fi
|
||||
}
|
||||
}
|
||||
|
||||
// Promote the render frame onto the shot, for shows that opted in.
|
||||
//
|
||||
// Only `generatedThumbnailUrl` is written — `thumbnailUrl` holds the
|
||||
// reference frame that came with the brief and the pipeline never touches
|
||||
// it. Shows that supply stills therefore look exactly as they did; shows
|
||||
// that supply none get their empty grids filled from the renders instead.
|
||||
let thumbnailPromoted = false;
|
||||
if (artifacts.thumbnailKey) {
|
||||
const shot = await tx.shot.findUnique({
|
||||
where: { id: exportRow.shotId },
|
||||
select: { project: { select: { pipelineConfig: true } } },
|
||||
});
|
||||
if (shot && autoShotThumbnailEnabled(shot.project)) {
|
||||
await tx.shot.update({
|
||||
where: { id: exportRow.shotId },
|
||||
data: {
|
||||
generatedThumbnailUrl: `/api/files/${artifacts.thumbnailKey}`,
|
||||
generatedThumbnailFrom: exportRow.versionString,
|
||||
},
|
||||
});
|
||||
thumbnailPromoted = true;
|
||||
}
|
||||
}
|
||||
|
||||
// The task title carries the version it is showing (house convention:
|
||||
// "UNG_102_019_010_cmp_TT_v004"). The preview just uploaded *is* the task's
|
||||
// new latest version, so the title has to follow the file — the same rename
|
||||
@@ -444,7 +468,8 @@ export async function finalizePreview(jobId: string, machineId: string, body: Fi
|
||||
? " — review version media replaced"
|
||||
: ` — review version created (${inheritedApproval ?? "PENDING_REVIEW"})`
|
||||
: " — no preview media reported") +
|
||||
(taskRenamed ? ` — task renamed to ${taskTitle}` : ""),
|
||||
(taskRenamed ? ` — task renamed to ${taskTitle}` : "") +
|
||||
(thumbnailPromoted ? " — shot thumbnail updated from this render" : ""),
|
||||
},
|
||||
{
|
||||
...(versionId ? { versionId } : {}),
|
||||
|
||||
Reference in New Issue
Block a user