Skip to content

Commit

Permalink
web/remux: display error if probe fails
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmoron committed Aug 17, 2024
1 parent 3bef12f commit 580ca04
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/i18n/en/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"import.invalid": "your file doesn't have valid cobalt settings to import. are you sure it's the right one?",
"import.unknown": "couldn't load data from the file. it may be corrupted or of wrong format. here's the error i got:\n{{ value }}",

"api.authentication": "couldn't confirm that you're not a robot. try again in a few seconds, or reload the page. this could be caused by a browser extension or your network.\n\nif error still occurs after several attempts, let us know, and we'll try to help!"
"api.authentication": "couldn't confirm that you're not a robot. try again in a few seconds, or reload the page. this could be caused by a browser extension or your network.\n\nif error still occurs after several attempts, let us know, and we'll try to help!",
"remux.corrupted": "couldn't read the metadata from this file, it may be corrupted."
}
17 changes: 17 additions & 0 deletions web/src/routes/remux/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import DropReceiver from "$components/misc/DropReceiver.svelte";
import FileReceiver from "$components/misc/FileReceiver.svelte";
import { createDialog } from "$lib/dialogs";
let draggedOver = false;
let file: File | undefined;
Expand Down Expand Up @@ -47,6 +48,22 @@
processing = true;
const file_info = await ff.probe(file);
if (!file_info?.format) {
return createDialog({
id: "remux-error",
type: "small",
meowbalt: "error",
bodyText: $t("error.remux.corrupted"),
buttons: [
{
text: $t("button.gotit"),
main: true,
action: () => {},
},
],
});
}
totalDuration = Number(file_info.format.duration);
const render = await ff.render({
Expand Down

0 comments on commit 580ca04

Please sign in to comment.