From 0ee3f248b85b40cf5bd4655dffb32839f89ec836 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 6 Apr 2024 03:51:52 -0400 Subject: [PATCH] fix(node-sub): escape path single quotes correctly --- devices/nos/modules/subtitles/node-syncsub/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices/nos/modules/subtitles/node-syncsub/main.ts b/devices/nos/modules/subtitles/node-syncsub/main.ts index 2768e2c..6858981 100755 --- a/devices/nos/modules/subtitles/node-syncsub/main.ts +++ b/devices/nos/modules/subtitles/node-syncsub/main.ts @@ -33,7 +33,7 @@ else { process.exit(1); } -const escapePath = (p: string) => p.replaceAll("'", "\\'"); +const escapePath = (p: string) => p.replaceAll("'", "'\\''"); function getVideoPath(files: string[]) { const fileName = DIR.split('/').at(-1) ?? ''; @@ -102,7 +102,7 @@ async function main() { ffProbe(VIDEO, (_e, data) => { if (!data?.streams) { console.error('Couldn\'t find streams in video file'); - process.exit(1); + process.exit(0); } const AVAIL_LANGS = data.streams