diff --git a/packages/api/src/controllers/asset.ts b/packages/api/src/controllers/asset.ts index 57acb6b8f..1f1ea3741 100644 --- a/packages/api/src/controllers/asset.ts +++ b/packages/api/src/controllers/asset.ts @@ -429,7 +429,7 @@ export async function withPlaybackUrls( asset: WithID, os?: ObjectStore, ): Promise> { - if (asset.files?.length < 1) { + if (asset.files?.length < 1 || asset.deleted) { // files is only set when playback is available return asset; } diff --git a/packages/api/src/controllers/stream.ts b/packages/api/src/controllers/stream.ts index 500b719b7..66a7c13ac 100644 --- a/packages/api/src/controllers/stream.ts +++ b/packages/api/src/controllers/stream.ts @@ -619,11 +619,12 @@ export async function getRecordingFields( const assetPhase = assetWithPlayback.status?.phase; return { recordingStatus: - assetPhase == "ready" - ? "ready" - : assetPhase == "failed" - ? "failed" - : "waiting", + { + ready: "ready", + failed: "failed", + deleting: "deleted", + deleted: "deleted", + }[assetPhase] ?? "waiting", recordingUrl: assetWithPlayback.playbackUrl, mp4Url: assetWithPlayback.downloadUrl, }; diff --git a/packages/api/src/schema/api-schema.yaml b/packages/api/src/schema/api-schema.yaml index 0fef17f16..ab4e8f8fe 100644 --- a/packages/api/src/schema/api-schema.yaml +++ b/packages/api/src/schema/api-schema.yaml @@ -941,6 +941,7 @@ components: - waiting - ready - failed + - deleted - none recordingUrl: type: string diff --git a/packages/www/components/Admin/Table-v2/cells/duration.tsx b/packages/www/components/Admin/Table-v2/cells/duration.tsx index f6e236115..5e39a3456 100644 --- a/packages/www/components/Admin/Table-v2/cells/duration.tsx +++ b/packages/www/components/Admin/Table-v2/cells/duration.tsx @@ -11,14 +11,18 @@ export type DurationCellProps = { const DurationCell = ({ cell, }: CellComponentProps) => { - if (cell.value.status === "waiting") { - return "In progress"; - } else if (cell.value.status === "failed") { - return "Failed"; + switch (cell.value.status) { + case "waiting": + return "In progress"; + case "failed": + return "Failed"; + case "deleted": + return "Deleted"; } if (cell.value.duration === 0 || cell.value.status !== "ready") { return "n/a"; } + try { const dur = intervalToDuration({ start: new Date(0), diff --git a/packages/www/components/Table/cells/duration.tsx b/packages/www/components/Table/cells/duration.tsx index bc81ebc5c..27fc9f575 100644 --- a/packages/www/components/Table/cells/duration.tsx +++ b/packages/www/components/Table/cells/duration.tsx @@ -10,10 +10,13 @@ export type DurationCellProps = { const DurationCell = ({ cell, }: CellComponentProps) => { - if (cell.value.status === "waiting") { - return "In progress"; - } else if (cell.value.status === "failed") { - return "Failed"; + switch (cell.value.status) { + case "waiting": + return "In progress"; + case "failed": + return "Failed"; + case "deleted": + return "Deleted"; } if ( cell.value.sourceSegmentsDuration === 0 || @@ -21,6 +24,7 @@ const DurationCell = ({ ) { return "n/a"; } + try { const durationMins = Math.round(cell.value.sourceSegmentsDuration / 60); if (!durationMins) {