Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a3859aa61b | |||
| 4cbb5d341c |
@@ -542,4 +542,5 @@ For reference, the endpoints called by `VFXReviewConnector.jsx`:
|
|||||||
| Retry Export | `POST /api/ext/exports/{id}/retry` (E14) |
|
| Retry Export | `POST /api/ext/exports/{id}/retry` (E14) |
|
||||||
| Regenerate Previews | `POST /api/ext/exports/{id}/regenerate-preview` |
|
| Regenerate Previews | `POST /api/ext/exports/{id}/regenerate-preview` |
|
||||||
| Load QC Queue | `GET /api/ext/qc/queue?projectCode={PROJECT_CODE}` (E5) |
|
| Load QC Queue | `GET /api/ext/qc/queue?projectCode={PROJECT_CODE}` (E5) |
|
||||||
|
| Build QC Review Session | `GET /api/ext/qc/queue?projectCode={PROJECT_CODE}` (E5): uses `scene`, `episode`, `seqTimecodeStart`, `handleHead`, `handleTail` |
|
||||||
| QC Pass / QC Fail | `POST /api/ext/exports/{id}/qc` (E4) |
|
| QC Pass / QC Fail | `POST /api/ext/exports/{id}/qc` (E4) |
|
||||||
|
|||||||
+1201
-15
File diff suppressed because it is too large
Load Diff
@@ -245,6 +245,7 @@ shot record, and submits it to the farm.
|
|||||||
|---|---|
|
|---|---|
|
||||||
| **Urgent** | Priority 20 — claimable outside the render window, ahead of normal jobs |
|
| **Urgent** | Priority 20 — claimable outside the render window, ahead of normal jobs |
|
||||||
| **No preview** | Renders the EXRs but builds no preview, inheriting the previous export's MOV, review MP4 and thumbnail |
|
| **No preview** | Renders the EXRs but builds no preview, inheriting the previous export's MOV, review MP4 and thumbnail |
|
||||||
|
| **Keep AEP** | Saves a reduced copy of the project in the export's version folder (see below) |
|
||||||
|
|
||||||
**No preview** exists for deliverables framed differently from the review —
|
**No preview** exists for deliverables framed differently from the review —
|
||||||
unscaled or un-punched-in EXRs. A preview rebuilt from those frames would be
|
unscaled or un-punched-in EXRs. A preview rebuilt from those frames would be
|
||||||
@@ -255,6 +256,37 @@ package still gets a MOV.
|
|||||||
Leave it unticked for an ordinary submission: the preview is what QC and the
|
Leave it unticked for an ordinary submission: the preview is what QC and the
|
||||||
client review see.
|
client review see.
|
||||||
|
|
||||||
|
#### Export AEP (Keep AEP)
|
||||||
|
|
||||||
|
With **Keep AEP** ticked (the default, remembered per machine), every export
|
||||||
|
keeps a copy of the project it was queued from, so the exact comp behind a
|
||||||
|
render can be reopened later:
|
||||||
|
|
||||||
|
```
|
||||||
|
{version folder}/{shotCode}_cmp_TT_{version}.aep e.g. .../UNG_102_019_010/v005/UNG_102_019_010_cmp_TT_v005.aep
|
||||||
|
```
|
||||||
|
|
||||||
|
- The copy is **reduced** to the exported comp and everything it uses (nested
|
||||||
|
comps, footage, solids). Everything else in the project is dropped.
|
||||||
|
- Nothing is collected. Plates and EXRs stay where they are and the copy links
|
||||||
|
to them by path, so it stays a few MB.
|
||||||
|
- It is saved after the export is submitted, into the same version folder the
|
||||||
|
farm renders into. The worker only reads and clears `*.exr` files there, so
|
||||||
|
the `.aep` is never touched. Re-queuing the same version overwrites it, just
|
||||||
|
as the render overwrites the EXRs.
|
||||||
|
- AE can only reduce the open project, so the panel does Save As, Reduce Project,
|
||||||
|
Save, and then **reopens your project**. Your project was saved first and is
|
||||||
|
never changed, but the reopen clears undo. Untick **Keep AEP** to skip it.
|
||||||
|
- The copy is the project as it was when you queued. The farm still renders
|
||||||
|
your working AEP, so a save made before the job starts goes into the render
|
||||||
|
but not into the copy.
|
||||||
|
- Reduce Project keeps only comps that are used as layers. An expression that
|
||||||
|
points at a comp with `comp("Name")`, where that comp isn't nested anywhere,
|
||||||
|
will break in the copy.
|
||||||
|
|
||||||
|
If the copy can't be saved, the export is still queued and the status line says
|
||||||
|
`AEP not saved: …` with the reason.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## QC
|
## QC
|
||||||
@@ -267,10 +299,63 @@ QC is per-export: a new export always needs new QC.
|
|||||||
|---|---|
|
|---|---|
|
||||||
| **Load QC Queue** | Lists every export in `READY_FOR_QC` for the selected project, oldest first. Entries flagged with a warning count had a non-blocking validation warning worth a closer look. |
|
| **Load QC Queue** | Lists every export in `READY_FOR_QC` for the selected project, oldest first. Entries flagged with a warning count had a non-blocking validation warning worth a closer look. |
|
||||||
| **Open Render** (or double-click) | Imports that export's actual EXR sequence into a `QC_{shot}_{version}` comp at full res and opens it. Re-selecting an already-imported shot just reopens the comp. |
|
| **Open Render** (or double-click) | Imports that export's actual EXR sequence into a `QC_{shot}_{version}` comp at full res and opens it. Re-selecting an already-imported shot just reopens the comp. |
|
||||||
|
| **Compare Versions** | Opens the QC comp and stacks earlier versions of the shot under the export, one layer each (`v003`, `v002`…), lined up by EXR timecode (or frame number). Solo a layer to see that version, or set the top layer to **Difference** to see exactly what changed. With more than one earlier version, a dialog lets you untick the ones you don't need. Versions already in the comp are skipped. |
|
||||||
|
| **Build QC Review Session** | Lays out the whole project's QC pass in one go. Every shot in the queue gets its `QC_{shot}_{version}` comp, and each scene gets an edit and a contact sheet. See *QC review session* below. |
|
||||||
| **Notes** | Sent with the decision. Optional on pass; a fail with no notes asks for confirmation, because the artist only sees what you write here. |
|
| **Notes** | Sent with the decision. Optional on pass; a fail with no notes asks for confirmation, because the artist only sees what you write here. |
|
||||||
| **QC Pass** | Marks the version **ready for delivery** and nothing else — nothing is shared to the client, no approval state changes, no task moves. |
|
| **QC Pass** | Marks the version **ready for delivery** and nothing else — nothing is shared to the client, no approval state changes, no task moves. |
|
||||||
| **QC Fail** | Sets the export to `QC_FAILED` and the comp task to **CHANGES**. The artist fixes and queues a new version; the old export is superseded. |
|
| **QC Fail** | Sets the export to `QC_FAILED` and the comp task to **CHANGES**. The artist fixes and queues a new version; the old export is superseded. |
|
||||||
|
|
||||||
|
**Where Compare Versions looks:** next to the export's own render folder (resolved
|
||||||
|
as for Open Render), in both on-disk layouts. That means farm version folders
|
||||||
|
(`{shot}/v002/`, `{shot}/v003/`…) and the older flat folder with
|
||||||
|
`{shot}_cmp_TT_{ver}.#####.exr` side by side. Only versions numbered below the
|
||||||
|
export's are used. If earlier exports were written under a different root (see
|
||||||
|
*More than one on-disk convention*), they won't be found.
|
||||||
|
|
||||||
|
### QC review session
|
||||||
|
|
||||||
|
**Build QC Review Session** loads the queue for the selected project. A dialog
|
||||||
|
lists its scenes. Ctrl-click a scene to leave it out, or untick *Also import
|
||||||
|
earlier versions*. Everything is built in one undo step, under
|
||||||
|
`QC_SESSION_{project}` in the Project panel:
|
||||||
|
|
||||||
|
| Item | What it is |
|
||||||
|
|---|---|
|
||||||
|
| `{scene}/shots/QC_{shot}_{version}` | One comp per shot, reusing the comp from Open Render if there is one. The export sits on top, earlier versions under it (`v003`, `v002`…), and the shot's plates at the bottom, found as Build Shot finds them. **Only the export and the main plate (the longest) are switched on.** |
|
||||||
|
| `{scene}/QC_EDIT_{scene}` | The scene's shot comps as one continuous edit. Each shot is cut to the edit, with the handles the render carries trimmed off, and has a layer marker with its name. |
|
||||||
|
| `{scene}/QC_CONTACT_{scene}` | Every shot of the scene in a grid, each starting at its cut in, with its name under it. |
|
||||||
|
| `_footage` | The EXR sequences it imported. Plates already in the project are reused, not imported again. |
|
||||||
|
|
||||||
|
A scene is the shot record's scene, which is not always the scene in the shot
|
||||||
|
code. Episodic shows group by episode too (`UNG_109_SC013`), and standard ones
|
||||||
|
by show (`DH2_VFX_SC033`). Shots run in sequence-timecode order when every shot
|
||||||
|
in the scene has one, and in shot-code order otherwise. Only the newest queued
|
||||||
|
version of a shot gets a comp; older queued versions appear as earlier versions
|
||||||
|
in it.
|
||||||
|
|
||||||
|
Plates and earlier versions are lined up with the export by EXR timecode. A
|
||||||
|
timecode more than a shot's length away is ignored, because a shot's elements
|
||||||
|
can carry unrelated camera timecodes. The file frame number is used next, then
|
||||||
|
the export's first frame. Exports from before handles were recorded have no
|
||||||
|
handle count, so they play in full in the edit, and the status line counts them.
|
||||||
|
|
||||||
|
Running the button again adds anything new to the shot comps and rebuilds the
|
||||||
|
scene edits and contact sheets from scratch. Don't do your own work in those
|
||||||
|
two comps.
|
||||||
|
|
||||||
|
**Approving from the session.** QC Pass and QC Fail act on the shot in front of
|
||||||
|
you, without finding it in the list:
|
||||||
|
|
||||||
|
- the `QC_{shot}_{version}` comp in the viewer, or
|
||||||
|
- the shot layer (or its label) selected in a scene edit or contact sheet, or
|
||||||
|
- with nothing selected in a scene edit, the shot under the playhead.
|
||||||
|
|
||||||
|
The confirmation names the shot, and a fail with notes is confirmed too when it
|
||||||
|
came from the viewer. If a scene comp is active and no shot is picked, nothing
|
||||||
|
is sent. Pick a shot, or switch to another comp to use the list selection. After
|
||||||
|
a decision, that shot's comp and its layers in the scene comps are labelled
|
||||||
|
**green** (pass) or **red** (fail).
|
||||||
|
|
||||||
Passing an export is what makes it eligible for a delivery package on the web
|
Passing an export is what makes it eligible for a delivery package on the web
|
||||||
app's **Pipeline → Deliveries** page.
|
app's **Pipeline → Deliveries** page.
|
||||||
|
|
||||||
|
|||||||
@@ -83,9 +83,6 @@ export function DeliveriesClient({ canBuild }: { canBuild: boolean }) {
|
|||||||
const [projectId, setProjectId] = useState<string>("");
|
const [projectId, setProjectId] = useState<string>("");
|
||||||
const [episode, setEpisode] = useState<string>("");
|
const [episode, setEpisode] = useState<string>("");
|
||||||
const [building, setBuilding] = useState(false);
|
const [building, setBuilding] = useState(false);
|
||||||
// Tracked as exclusions so every ready shot — including one that passes QC
|
|
||||||
// while the page is open — starts selected.
|
|
||||||
const [deselected, setDeselected] = useState<Set<string>>(() => new Set());
|
|
||||||
const [handoff, setHandoff] = useState<{ step: "upload" | "share"; packageId: string } | null>(null);
|
const [handoff, setHandoff] = useState<{ step: "upload" | "share"; packageId: string } | null>(null);
|
||||||
|
|
||||||
const { data: projects } = useQuery({
|
const { data: projects } = useQuery({
|
||||||
@@ -119,36 +116,14 @@ export function DeliveriesClient({ canBuild }: { canBuild: boolean }) {
|
|||||||
refetchInterval: 5000,
|
refetchInterval: 5000,
|
||||||
});
|
});
|
||||||
|
|
||||||
function toggleExport(exportId: string, selected: boolean) {
|
async function build(ep: string) {
|
||||||
setDeselected((prev) => {
|
if (!projectId) return;
|
||||||
const next = new Set(prev);
|
|
||||||
if (selected) next.delete(exportId);
|
|
||||||
else next.add(exportId);
|
|
||||||
return next;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function setEpisodeSelected(exportIds: string[], selected: boolean) {
|
|
||||||
setDeselected((prev) => {
|
|
||||||
const next = new Set(prev);
|
|
||||||
for (const id of exportIds) {
|
|
||||||
if (selected) next.delete(id);
|
|
||||||
else next.add(id);
|
|
||||||
}
|
|
||||||
return next;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function build(ep: string, exportIds: string[]) {
|
|
||||||
if (!projectId || exportIds.length === 0) return;
|
|
||||||
setBuilding(true);
|
setBuilding(true);
|
||||||
try {
|
try {
|
||||||
// Always send the explicit list: the package holds exactly the shots
|
|
||||||
// ticked on screen, never one that turned ready since the page loaded.
|
|
||||||
const res = await fetch("/api/deliveries", {
|
const res = await fetch("/api/deliveries", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ projectId, episode: ep || null, exportIds }),
|
body: JSON.stringify({ projectId, episode: ep || null }),
|
||||||
});
|
});
|
||||||
const body = await res.json().catch(() => ({}));
|
const body = await res.json().catch(() => ({}));
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
@@ -204,7 +179,6 @@ export function DeliveriesClient({ canBuild }: { canBuild: boolean }) {
|
|||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setProjectId(e.target.value);
|
setProjectId(e.target.value);
|
||||||
setEpisode("");
|
setEpisode("");
|
||||||
setDeselected(new Set());
|
|
||||||
}}
|
}}
|
||||||
className="rounded-md border border-zinc-800 bg-zinc-900 px-3 py-1.5 text-sm text-zinc-200"
|
className="rounded-md border border-zinc-800 bg-zinc-900 px-3 py-1.5 text-sm text-zinc-200"
|
||||||
>
|
>
|
||||||
@@ -245,69 +219,30 @@ export function DeliveriesClient({ canBuild }: { canBuild: boolean }) {
|
|||||||
Nothing has passed QC yet. Exports appear here once QC passes them.
|
Nothing has passed QC yet. Exports appear here once QC passes them.
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{shown.map((ep) => {
|
{shown.map((ep) => (
|
||||||
const allIds = ep.exports.map((x) => x.exportId);
|
|
||||||
const selectedIds = allIds.filter((id) => !deselected.has(id));
|
|
||||||
const allSelected = selectedIds.length === allIds.length;
|
|
||||||
const selectedExports = ep.exports.filter((x) => !deselected.has(x.exportId));
|
|
||||||
const missingChecksum = selectedExports.filter((x) => !x.hasChecksum).length;
|
|
||||||
return (
|
|
||||||
<div key={ep.episode} className="border-b border-zinc-800/60 last:border-0">
|
<div key={ep.episode} className="border-b border-zinc-800/60 last:border-0">
|
||||||
<div className="flex items-center justify-between gap-4 px-4 py-3 flex-wrap">
|
<div className="flex items-center justify-between gap-4 px-4 py-3 flex-wrap">
|
||||||
<div>
|
<div>
|
||||||
<span className="text-white text-sm font-medium">
|
<span className="text-white text-sm font-medium">
|
||||||
{ep.episode ? `Episode ${ep.episode}` : "No episode"}
|
{ep.episode ? `Episode ${ep.episode}` : "No episode"}
|
||||||
</span>
|
</span>
|
||||||
<span className="ml-3 text-sm text-zinc-400">
|
<span className="ml-3 text-sm text-zinc-400">Ready: {ep.count} shots</span>
|
||||||
{canBuild ? `Selected: ${selectedIds.length} of ${ep.count} shots` : `Ready: ${ep.count} shots`}
|
{ep.exports.some((x) => !x.hasChecksum) && (
|
||||||
</span>
|
|
||||||
{canBuild && selectedIds.length > 0 && (
|
|
||||||
<span className="ml-3 text-xs text-zinc-500">
|
|
||||||
{formatBytes(selectedExports.reduce((sum, x) => sum + (x.totalBytes ?? 0), 0))}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{missingChecksum > 0 && (
|
|
||||||
<span className="ml-3 text-xs text-amber-400">
|
<span className="ml-3 text-xs text-amber-400">
|
||||||
{missingChecksum} without a validation checksum
|
{ep.exports.filter((x) => !x.hasChecksum).length} without a validation checksum
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{canBuild && (
|
{canBuild && (
|
||||||
<span className="flex items-center gap-2">
|
<Button size="sm" onClick={() => build(ep.episode)} disabled={building}>
|
||||||
<Button
|
<Package className="h-4 w-4 mr-2" />
|
||||||
size="sm"
|
Build delivery
|
||||||
variant="outline"
|
</Button>
|
||||||
onClick={() => setEpisodeSelected(allIds, !allSelected)}
|
|
||||||
>
|
|
||||||
{allSelected ? "Deselect all" : "Select all"}
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
size="sm"
|
|
||||||
onClick={() => build(ep.episode, selectedIds)}
|
|
||||||
disabled={building || selectedIds.length === 0}
|
|
||||||
>
|
|
||||||
<Package className="h-4 w-4 mr-2" />
|
|
||||||
Build delivery ({selectedIds.length})
|
|
||||||
</Button>
|
|
||||||
</span>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="px-4 pb-3 grid sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-1">
|
<div className="px-4 pb-3 grid sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-1">
|
||||||
{ep.exports.map((x) => {
|
{ep.exports.map((x) => (
|
||||||
const selected = !deselected.has(x.exportId);
|
<div key={x.exportId} className="flex items-center gap-2 text-xs">
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={x.exportId}
|
|
||||||
className={cn("flex items-center gap-2 text-xs", canBuild && !selected && "opacity-50")}
|
|
||||||
>
|
|
||||||
{canBuild && (
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={selected}
|
|
||||||
onChange={(e) => toggleExport(x.exportId, e.target.checked)}
|
|
||||||
aria-label={`Include ${x.shotCode} in the package`}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<Link href={`/pipeline/exports/${x.exportId}`} className="text-zinc-300 hover:text-white">
|
<Link href={`/pipeline/exports/${x.exportId}`} className="text-zinc-300 hover:text-white">
|
||||||
{x.shotCode}
|
{x.shotCode}
|
||||||
</Link>
|
</Link>
|
||||||
@@ -316,12 +251,10 @@ export function DeliveriesClient({ canBuild }: { canBuild: boolean }) {
|
|||||||
<span className="text-zinc-600">{formatBytes(x.totalBytes)}</span>
|
<span className="text-zinc-600">{formatBytes(x.totalBytes)}</span>
|
||||||
{!x.deliveryMovPath && <span className="text-amber-500/80">no MOV</span>}
|
{!x.deliveryMovPath && <span className="text-amber-500/80">no MOV</span>}
|
||||||
</div>
|
</div>
|
||||||
);
|
))}
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
))}
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import { TaskCard } from "@/components/tasks/TaskCard";
|
|||||||
import { NewTaskDialog } from "@/components/tasks/NewTaskDialog";
|
import { NewTaskDialog } from "@/components/tasks/NewTaskDialog";
|
||||||
import { KanbanBoard } from "@/components/tasks/KanbanBoard";
|
import { KanbanBoard } from "@/components/tasks/KanbanBoard";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { sortShotsForList } from "@/lib/shot-order";
|
|
||||||
import { Film, Package, ListTodo, LayoutDashboard, Plus, Settings, FileUp, ChevronDown, ChevronRight, Calendar, Pencil, Check, X } from "lucide-react";
|
import { Film, Package, ListTodo, LayoutDashboard, Plus, Settings, FileUp, ChevronDown, ChevronRight, Calendar, Pencil, Check, X } from "lucide-react";
|
||||||
import type { ShotWithDetails } from "@/types";
|
import type { ShotWithDetails } from "@/types";
|
||||||
import { ProjectSettingsTab } from "@/components/projects/ProjectSettingsTab";
|
import { ProjectSettingsTab } from "@/components/projects/ProjectSettingsTab";
|
||||||
@@ -148,7 +147,13 @@ export function ProjectTabsClient({
|
|||||||
// For episodic projects: group and sort shots by episode → scene → shotNumber
|
// For episodic projects: group and sort shots by episode → scene → shotNumber
|
||||||
const episodeGroups: [string, ShotWithDetails[]][] = projectType === "EPISODIC"
|
const episodeGroups: [string, ShotWithDetails[]][] = projectType === "EPISODIC"
|
||||||
? (() => {
|
? (() => {
|
||||||
const sorted = sortShotsForList(shots, projectType);
|
const sorted = [...shots].sort((a, b) => {
|
||||||
|
const ea = a.episode ?? "";
|
||||||
|
const eb = b.episode ?? "";
|
||||||
|
if (ea !== eb) return ea.localeCompare(eb, undefined, { numeric: true });
|
||||||
|
if (a.scene !== b.scene) return a.scene.localeCompare(b.scene, undefined, { numeric: true });
|
||||||
|
return a.shotNumber - b.shotNumber;
|
||||||
|
});
|
||||||
const map = new Map<string, ShotWithDetails[]>();
|
const map = new Map<string, ShotWithDetails[]>();
|
||||||
for (const shot of sorted) {
|
for (const shot of sorted) {
|
||||||
const key = shot.episode ?? "(No Episode)";
|
const key = shot.episode ?? "(No Episode)";
|
||||||
@@ -162,7 +167,13 @@ export function ProjectTabsClient({
|
|||||||
// For standard projects: group by custom shot group when any exist
|
// For standard projects: group by custom shot group when any exist
|
||||||
const standardGroups: [string, ShotWithDetails[]][] = projectType === "STANDARD" && shots.some((s) => s.shotGroup)
|
const standardGroups: [string, ShotWithDetails[]][] = projectType === "STANDARD" && shots.some((s) => s.shotGroup)
|
||||||
? (() => {
|
? (() => {
|
||||||
const sorted = sortShotsForList(shots, projectType);
|
const sorted = [...shots].sort((a, b) => {
|
||||||
|
const ga = a.shotGroup?.name ?? "\uFFFF";
|
||||||
|
const gb = b.shotGroup?.name ?? "\uFFFF";
|
||||||
|
if (ga !== gb) return ga.localeCompare(gb, undefined, { numeric: true });
|
||||||
|
if (a.scene !== b.scene) return a.scene.localeCompare(b.scene, undefined, { numeric: true });
|
||||||
|
return a.shotNumber - b.shotNumber;
|
||||||
|
});
|
||||||
const map = new Map<string, ShotWithDetails[]>();
|
const map = new Map<string, ShotWithDetails[]>();
|
||||||
for (const shot of sorted) {
|
for (const shot of sorted) {
|
||||||
const key = shot.shotGroup?.name ?? "(Ungrouped)";
|
const key = shot.shotGroup?.name ?? "(Ungrouped)";
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ import {
|
|||||||
Pencil,
|
Pencil,
|
||||||
Check,
|
Check,
|
||||||
LayoutList,
|
LayoutList,
|
||||||
ChevronLeft,
|
|
||||||
ChevronRight,
|
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import type { ShotWithDetails } from "@/types";
|
import type { ShotWithDetails } from "@/types";
|
||||||
@@ -80,47 +78,12 @@ const PRIORITY_CONFIG: Record<string, { label: string; dot: string }> = {
|
|||||||
import { useToast } from "@/components/ui/use-toast";
|
import { useToast } from "@/components/ui/use-toast";
|
||||||
import { shotThumbnail } from "@/lib/shot-thumbnail";
|
import { shotThumbnail } from "@/lib/shot-thumbnail";
|
||||||
|
|
||||||
type ShotNavTarget = { id: string; shotCode: string } | null;
|
|
||||||
type ShotNav = { prev: ShotNavTarget; next: ShotNavTarget; position: number; total: number };
|
|
||||||
|
|
||||||
function ShotNavLink({
|
|
||||||
projectId,
|
|
||||||
target,
|
|
||||||
direction,
|
|
||||||
}: {
|
|
||||||
projectId: string;
|
|
||||||
target: ShotNavTarget;
|
|
||||||
direction: "prev" | "next";
|
|
||||||
}) {
|
|
||||||
const Icon = direction === "prev" ? ChevronLeft : ChevronRight;
|
|
||||||
const label = direction === "prev" ? "Previous shot" : "Next shot";
|
|
||||||
if (!target) {
|
|
||||||
return (
|
|
||||||
<Button variant="outline" size="sm" disabled className="h-7 gap-1 px-2 font-mono text-xs">
|
|
||||||
{direction === "prev" && <Icon className="h-3.5 w-3.5" />}
|
|
||||||
<span className="hidden sm:inline">{direction === "prev" ? "Prev" : "Next"}</span>
|
|
||||||
{direction === "next" && <Icon className="h-3.5 w-3.5" />}
|
|
||||||
</Button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<Button variant="outline" size="sm" asChild className="h-7 gap-1 px-2 font-mono text-xs">
|
|
||||||
<Link href={`/projects/${projectId}/shots/${target.id}`} title={`${label}: ${target.shotCode}`}>
|
|
||||||
{direction === "prev" && <Icon className="h-3.5 w-3.5" />}
|
|
||||||
<span className="hidden sm:inline max-w-[10rem] truncate">{target.shotCode}</span>
|
|
||||||
{direction === "next" && <Icon className="h-3.5 w-3.5" />}
|
|
||||||
</Link>
|
|
||||||
</Button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function ShotDetailPage() {
|
export default function ShotDetailPage() {
|
||||||
const params = useParams<{ id: string; shotId: string }>();
|
const params = useParams<{ id: string; shotId: string }>();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const [shot, setShot] = useState<ShotWithDetails | null>(null);
|
const [shot, setShot] = useState<ShotWithDetails | null>(null);
|
||||||
const [projectName, setProjectName] = useState<string>("");
|
const [projectName, setProjectName] = useState<string>("");
|
||||||
const [shotNav, setShotNav] = useState<ShotNav | null>(null);
|
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [canApprove, setCanApprove] = useState(false);
|
const [canApprove, setCanApprove] = useState(false);
|
||||||
const [canInternallyApprove, setCanInternallyApprove] = useState(false);
|
const [canInternallyApprove, setCanInternallyApprove] = useState(false);
|
||||||
@@ -145,7 +108,6 @@ export default function ShotDetailPage() {
|
|||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
setShot(data.shot);
|
setShot(data.shot);
|
||||||
setProjectName(data.projectName ?? "");
|
setProjectName(data.projectName ?? "");
|
||||||
setShotNav(data.shotNav ?? null);
|
|
||||||
setCanApprove(data.canApprove ?? false);
|
setCanApprove(data.canApprove ?? false);
|
||||||
setCanInternallyApprove(data.canInternallyApprove ?? false);
|
setCanInternallyApprove(data.canInternallyApprove ?? false);
|
||||||
setTasks(data.tasks ?? []);
|
setTasks(data.tasks ?? []);
|
||||||
@@ -280,17 +242,6 @@ export default function ShotDetailPage() {
|
|||||||
</Link>
|
</Link>
|
||||||
<span>/</span>
|
<span>/</span>
|
||||||
<span className="text-foreground font-mono">{shot.shotCode}</span>
|
<span className="text-foreground font-mono">{shot.shotCode}</span>
|
||||||
|
|
||||||
{/* Prev / next shot, in the project page's list order */}
|
|
||||||
{shotNav && shotNav.total > 1 && (
|
|
||||||
<div className="ml-auto flex items-center gap-1">
|
|
||||||
<ShotNavLink projectId={params.id} target={shotNav.prev} direction="prev" />
|
|
||||||
<span className="px-1 text-xs tabular-nums">
|
|
||||||
{shotNav.position} / {shotNav.total}
|
|
||||||
</span>
|
|
||||||
<ShotNavLink projectId={params.id} target={shotNav.next} direction="next" />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { NextRequest, NextResponse } from "next/server";
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
import { auth } from "@/auth";
|
import { auth } from "@/auth";
|
||||||
import { db } from "@/lib/db";
|
import { db } from "@/lib/db";
|
||||||
import { sortShotsForList } from "@/lib/shot-order";
|
|
||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
req: NextRequest,
|
req: NextRequest,
|
||||||
@@ -39,35 +38,9 @@ export async function GET(
|
|||||||
|
|
||||||
const project = await db.project.findUnique({
|
const project = await db.project.findUnique({
|
||||||
where: { id: shot.projectId },
|
where: { id: shot.projectId },
|
||||||
select: {
|
select: { name: true },
|
||||||
name: true,
|
|
||||||
projectType: true,
|
|
||||||
shots: {
|
|
||||||
orderBy: { createdAt: "asc" },
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
shotCode: true,
|
|
||||||
episode: true,
|
|
||||||
scene: true,
|
|
||||||
shotNumber: true,
|
|
||||||
shotGroup: { select: { name: true } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Neighbours in the project page's shot list order, for prev/next navigation
|
|
||||||
const orderedShots = project ? sortShotsForList(project.shots, project.projectType) : [];
|
|
||||||
const shotIndex = orderedShots.findIndex((s) => s.id === shotId);
|
|
||||||
const neighbour = (i: number) =>
|
|
||||||
shotIndex >= 0 && orderedShots[i] ? { id: orderedShots[i].id, shotCode: orderedShots[i].shotCode } : null;
|
|
||||||
const shotNav = {
|
|
||||||
prev: neighbour(shotIndex - 1),
|
|
||||||
next: neighbour(shotIndex + 1),
|
|
||||||
position: shotIndex + 1,
|
|
||||||
total: orderedShots.length,
|
|
||||||
};
|
|
||||||
|
|
||||||
const [tasks, artists] = await Promise.all([
|
const [tasks, artists] = await Promise.all([
|
||||||
db.task.findMany({
|
db.task.findMany({
|
||||||
where: { shotId },
|
where: { shotId },
|
||||||
@@ -126,7 +99,6 @@ export async function GET(
|
|||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
shot: shotSerialized,
|
shot: shotSerialized,
|
||||||
projectName: project?.name ?? "",
|
projectName: project?.name ?? "",
|
||||||
shotNav,
|
|
||||||
canApprove,
|
canApprove,
|
||||||
canInternallyApprove: ["ADMIN", "PRODUCER", "SUPERVISOR"].includes(session.user.role as string),
|
canInternallyApprove: ["ADMIN", "PRODUCER", "SUPERVISOR"].includes(session.user.role as string),
|
||||||
tasks,
|
tasks,
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ export async function getQCQueue(filter: QCQueueFilter) {
|
|||||||
orderBy: { statusChangedAt: "asc" }, // oldest first — nothing should sit in QC
|
orderBy: { statusChangedAt: "asc" }, // oldest first — nothing should sit in QC
|
||||||
take: limit,
|
take: limit,
|
||||||
include: {
|
include: {
|
||||||
shot: { select: { id: true, shotCode: true, episode: true, scene: true, project: { select: { code: true, name: true } } } },
|
shot: { select: { id: true, shotCode: true, episode: true, scene: true, seqTimecodeStart: true, project: { select: { code: true, name: true } } } },
|
||||||
validations: { where: { status: { in: ["FAIL", "WARN"] } }, select: { checkName: true, status: true, message: true } },
|
validations: { where: { status: { in: ["FAIL", "WARN"] } }, select: { checkName: true, status: true, message: true } },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -167,6 +167,11 @@ export async function getQCQueue(filter: QCQueueFilter) {
|
|||||||
frameStart: e.frameStart,
|
frameStart: e.frameStart,
|
||||||
frameEnd: e.frameEnd,
|
frameEnd: e.frameEnd,
|
||||||
fps: e.fps,
|
fps: e.fps,
|
||||||
|
// The panel's QC session cuts each shot into a scene edit: in edit order,
|
||||||
|
// with the handles the render carries trimmed off. Null on old exports.
|
||||||
|
seqTimecodeStart: e.shot.seqTimecodeStart,
|
||||||
|
handleHead: e.handleHead,
|
||||||
|
handleTail: e.handleTail,
|
||||||
deliveryMovPath: e.deliveryMovPath,
|
deliveryMovPath: e.deliveryMovPath,
|
||||||
thumbnailUrl: e.thumbnailKey ? `/api/files/${e.thumbnailKey}` : null,
|
thumbnailUrl: e.thumbnailKey ? `/api/files/${e.thumbnailKey}` : null,
|
||||||
previewUrl: e.previewMovKey ? `/api/files/${e.previewMovKey}` : null,
|
previewUrl: e.previewMovKey ? `/api/files/${e.previewMovKey}` : null,
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
// The order shots appear in on the project page's Shots tab. Shared with the
|
|
||||||
// shot detail page so its previous/next navigation walks the same list.
|
|
||||||
|
|
||||||
type OrderableShot = {
|
|
||||||
episode?: string | null;
|
|
||||||
scene: string;
|
|
||||||
shotNumber: number;
|
|
||||||
shotGroup?: { name: string } | null;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function sortShotsForList<T extends OrderableShot>(shots: T[], projectType: string): T[] {
|
|
||||||
// Episodic: episode → scene → shotNumber
|
|
||||||
if (projectType === "EPISODIC") {
|
|
||||||
return [...shots].sort((a, b) => {
|
|
||||||
const ea = a.episode ?? "";
|
|
||||||
const eb = b.episode ?? "";
|
|
||||||
if (ea !== eb) return ea.localeCompare(eb, undefined, { numeric: true });
|
|
||||||
if (a.scene !== b.scene) return a.scene.localeCompare(b.scene, undefined, { numeric: true });
|
|
||||||
return a.shotNumber - b.shotNumber;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Standard with custom groups: group → scene → shotNumber, ungrouped last
|
|
||||||
if (projectType === "STANDARD" && shots.some((s) => s.shotGroup)) {
|
|
||||||
return [...shots].sort((a, b) => {
|
|
||||||
const ga = a.shotGroup?.name ?? "";
|
|
||||||
const gb = b.shotGroup?.name ?? "";
|
|
||||||
if (ga !== gb) return ga.localeCompare(gb, undefined, { numeric: true });
|
|
||||||
if (a.scene !== b.scene) return a.scene.localeCompare(b.scene, undefined, { numeric: true });
|
|
||||||
return a.shotNumber - b.shotNumber;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise the list keeps the query's createdAt order
|
|
||||||
return shots;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user