fix command generation

This commit is contained in:
Sam Lavigne 2023-09-02 11:03:58 -04:00
parent baf812d6ad
commit c091ff72ba
1 changed files with 2 additions and 2 deletions

View File

@ -105,6 +105,7 @@ export const previewCommand = derived([edges, nodes], ([$edges, $nodes]) => {
const eid = edgeIds[i.id]; const eid = edgeIds[i.id];
if (eid) { if (eid) {
if (typeof eid == "string" && eid.includes(":")) cmd.weight = -1000; if (typeof eid == "string" && eid.includes(":")) cmd.weight = -1000;
else cmd.weight = eid;
cmd.in.push(eid); cmd.in.push(eid);
} }
} }
@ -115,7 +116,6 @@ export const previewCommand = derived([edges, nodes], ([$edges, $nodes]) => {
const eid = edgeIds[o.id]; const eid = edgeIds[o.id];
if (eid) { if (eid) {
if (typeof eid == "string" && eid.includes("out")) cmd.weight = 1000; if (typeof eid == "string" && eid.includes("out")) cmd.weight = 1000;
else cmd.weight = eid;
cmd.out.push(eid); cmd.out.push(eid);
} }
} }
@ -151,7 +151,7 @@ export const previewCommand = derived([edges, nodes], ([$edges, $nodes]) => {
let fg = `"${filtergraph.join(";")}"`; let fg = `"${filtergraph.join(";")}"`;
// this crazy thing replaces stuff like [1];[1] with a comma! // this crazy thing replaces stuff like [1];[1] with a comma!
fg = fg.replaceAll(/(\[\d+\]);\1(?!\[)/g, ","); fg = fg.replaceAll(/(?<!])(\[\d+\]);\1(?!\[)/g, ",");
finalCommand.push("-filter_complex", fg); finalCommand.push("-filter_complex", fg);