mirror of
https://github.com/imputnet/cobalt.git
synced 2025-02-17 10:50:11 +00:00
web/remux: correctly unset processing state
This commit is contained in:
parent
0e461d4ebe
commit
d446dfd87e
|
@ -43,43 +43,44 @@
|
||||||
const render = async () => {
|
const render = async () => {
|
||||||
if (!file || processing) return;
|
if (!file || processing) return;
|
||||||
await ff.init();
|
await ff.init();
|
||||||
|
try {
|
||||||
|
progress = '';
|
||||||
|
processing = true;
|
||||||
|
|
||||||
progress = '';
|
const file_info = await ff.probe(file);
|
||||||
processing = true;
|
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: () => {},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const file_info = await ff.probe(file);
|
totalDuration = Number(file_info.format.duration);
|
||||||
if (!file_info?.format) {
|
|
||||||
return createDialog({
|
const render = await ff.render({
|
||||||
id: "remux-error",
|
blob: file,
|
||||||
type: "small",
|
args: ['-c', 'copy', '-map', '0']
|
||||||
meowbalt: "error",
|
|
||||||
bodyText: $t("error.remux.corrupted"),
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
text: $t("button.gotit"),
|
|
||||||
main: true,
|
|
||||||
action: () => {},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (render) {
|
||||||
|
openURL(URL.createObjectURL(render));
|
||||||
|
} else {
|
||||||
|
console.log("not a valid file");
|
||||||
|
}
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
processing = false;
|
||||||
|
file = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
totalDuration = Number(file_info.format.duration);
|
|
||||||
|
|
||||||
const render = await ff.render({
|
|
||||||
blob: file,
|
|
||||||
args: ['-c', 'copy', '-map', '0']
|
|
||||||
});
|
|
||||||
|
|
||||||
processing = false;
|
|
||||||
|
|
||||||
if (render) {
|
|
||||||
openURL(URL.createObjectURL(render));
|
|
||||||
} else {
|
|
||||||
console.log("not a valid file");
|
|
||||||
}
|
|
||||||
|
|
||||||
file = undefined;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$: if (file) {
|
$: if (file) {
|
||||||
|
|
Loading…
Reference in a new issue