mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 09:28:29 +00:00
web/task-manager/queue: show a dialog on error
This commit is contained in:
parent
683f161520
commit
eeda4beb25
@ -10,4 +10,5 @@
|
|||||||
|
|
||||||
"captcha_ongoing": "cloudflare turnstile is still checking if you're not a bot. if it takes too long, you can try: disabling weird browser extensions, changing networks, using a different browser, or checking your device for malware.",
|
"captcha_ongoing": "cloudflare turnstile is still checking if you're not a bot. if it takes too long, you can try: disabling weird browser extensions, changing networks, using a different browser, or checking your device for malware.",
|
||||||
|
|
||||||
|
"pipeline.missing_response_data": "the processing instance didn't return required file info, so i can't create a local processing pipeline for you. try again in a few seconds and report the issue if it sticks!"
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
|
import { get } from "svelte/store";
|
||||||
|
import { t } from "$lib/i18n/translations";
|
||||||
import { ffmpegMetadataArgs } from "$lib/util";
|
import { ffmpegMetadataArgs } from "$lib/util";
|
||||||
|
import { createDialog } from "$lib/state/dialogs";
|
||||||
import { addItem } from "$lib/state/task-manager/queue";
|
import { addItem } from "$lib/state/task-manager/queue";
|
||||||
import { openQueuePopover } from "$lib/state/queue-visibility";
|
import { openQueuePopover } from "$lib/state/queue-visibility";
|
||||||
|
|
||||||
@ -15,7 +18,6 @@ export const getMediaType = (type: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const createRemuxPipeline = (file: File) => {
|
export const createRemuxPipeline = (file: File) => {
|
||||||
// chopped khia
|
|
||||||
const parentId = crypto.randomUUID();
|
const parentId = crypto.randomUUID();
|
||||||
const mediaType = getMediaType(file.type);
|
const mediaType = getMediaType(file.type);
|
||||||
|
|
||||||
@ -58,9 +60,27 @@ const mediaIcons: { [key: string]: CobaltPipelineResultFileType } = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const createSavePipeline = (info: CobaltLocalProcessingResponse, request: CobaltSaveRequestBody) => {
|
export const createSavePipeline = (info: CobaltLocalProcessingResponse, request: CobaltSaveRequestBody) => {
|
||||||
// TODO: proper error here
|
// this is a pre-queue part of processing,
|
||||||
|
// so errors have to be returned via a regular dialog
|
||||||
|
|
||||||
|
const error = (errorCode: string) => {
|
||||||
|
return createDialog({
|
||||||
|
id: "pipeline-error",
|
||||||
|
type: "small",
|
||||||
|
meowbalt: "error",
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: get(t)("button.gotit"),
|
||||||
|
main: true,
|
||||||
|
action: () => {},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
bodyText: get(t)(`error.${errorCode}`),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (!info.output?.filename || !info.output?.type) {
|
if (!info.output?.filename || !info.output?.type) {
|
||||||
return;
|
return error("pipeline.missing_response_data");
|
||||||
}
|
}
|
||||||
|
|
||||||
const parentId = crypto.randomUUID();
|
const parentId = crypto.randomUUID();
|
||||||
@ -107,7 +127,9 @@ export const createSavePipeline = (info: CobaltLocalProcessingResponse, request:
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else if (info.type === "audio") {
|
} else if (info.type === "audio") {
|
||||||
if (!info.audio) return; // TODO: proper error
|
if (!info.audio) {
|
||||||
|
return error("pipeline.missing_response_data");
|
||||||
|
}
|
||||||
|
|
||||||
const ffargs = [
|
const ffargs = [
|
||||||
"-vn",
|
"-vn",
|
||||||
|
Loading…
Reference in New Issue
Block a user