mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-24 18:42:09 +02:00
web/types: create uuid alias for worker ids
This commit is contained in:
parent
78cf73b34e
commit
47683cecec
@ -1,8 +1,10 @@
|
||||
import type { CobaltSaveRequestBody } from "$lib/types/api";
|
||||
import type { CobaltPipelineItem, CobaltPipelineResultFileType } from "$lib/types/workers";
|
||||
|
||||
export type UUID = string;
|
||||
|
||||
type CobaltQueueBaseItem = {
|
||||
id: string,
|
||||
id: UUID,
|
||||
pipeline: CobaltPipelineItem[],
|
||||
canRetry?: boolean,
|
||||
originalRequest?: CobaltSaveRequestBody,
|
||||
@ -17,7 +19,7 @@ type CobaltQueueItemWaiting = CobaltQueueBaseItem & {
|
||||
|
||||
export type CobaltQueueItemRunning = CobaltQueueBaseItem & {
|
||||
state: "running",
|
||||
completedWorkers: Set<string>,
|
||||
completedWorkers: Set<UUID>,
|
||||
pipelineResults: File[],
|
||||
};
|
||||
|
||||
@ -37,5 +39,5 @@ export type CobaltQueueItem = CobaltQueueItemWaiting
|
||||
| CobaltQueueItemError;
|
||||
|
||||
export type CobaltQueue = {
|
||||
[id: string]: CobaltQueueItem,
|
||||
[id: UUID]: CobaltQueueItem,
|
||||
};
|
||||
|
@ -1,11 +1,12 @@
|
||||
import type { CobaltPipelineItem, CobaltWorkerProgress } from "$lib/types/workers";
|
||||
import type { UUID } from "./queue";
|
||||
|
||||
export type CobaltCurrentTaskItem = {
|
||||
type: CobaltPipelineItem['worker'],
|
||||
parentId: string,
|
||||
parentId: UUID,
|
||||
progress?: CobaltWorkerProgress,
|
||||
}
|
||||
|
||||
export type CobaltCurrentTasks = {
|
||||
[id: string]: CobaltCurrentTaskItem,
|
||||
[id: UUID]: CobaltCurrentTaskItem,
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import type { FileInfo } from "$lib/types/libav";
|
||||
import type { UUID } from "./queue";
|
||||
|
||||
export const resultFileTypes = ["video", "audio", "image"] as const;
|
||||
|
||||
@ -17,9 +18,9 @@ type CobaltFFmpegWorkerArgs = {
|
||||
};
|
||||
|
||||
type CobaltPipelineItemBase = {
|
||||
workerId: string,
|
||||
parentId: string,
|
||||
dependsOn?: string[],
|
||||
workerId: UUID,
|
||||
parentId: UUID,
|
||||
dependsOn?: UUID[],
|
||||
};
|
||||
|
||||
type CobaltRemuxPipelineItem = CobaltPipelineItemBase & {
|
||||
|
Loading…
x
Reference in New Issue
Block a user