From 80802d44e360d31d7f6cf740b49df8413fc36252 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 24 Apr 2024 14:49:29 +0530 Subject: [PATCH] Better log --- web/apps/photos/src/worker/ffmpeg.worker.ts | 26 +++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/web/apps/photos/src/worker/ffmpeg.worker.ts b/web/apps/photos/src/worker/ffmpeg.worker.ts index a9f2ad56bc..03893efba6 100644 --- a/web/apps/photos/src/worker/ffmpeg.worker.ts +++ b/web/apps/photos/src/worker/ffmpeg.worker.ts @@ -64,7 +64,7 @@ const ffmpegExec = async ( try { ffmpeg.FS("writeFile", inputPath, inputData); - log.info(`Running FFmpeg (wasm) command ${cmd}`); + log.debug(() => `[wasm] ffmpeg ${cmd.join(" ")}`); await ffmpeg.run(...cmd); return ffmpeg.FS("readFile", outputPath); @@ -98,14 +98,16 @@ const substitutePlaceholders = ( inputFilePath: string, outputFilePath: string, ) => - command.map((segment) => { - if (segment == ffmpegPathPlaceholder) { - return ""; - } else if (segment == inputPathPlaceholder) { - return inputFilePath; - } else if (segment == outputPathPlaceholder) { - return outputFilePath; - } else { - return segment; - } - }); + command + .map((segment) => { + if (segment == ffmpegPathPlaceholder) { + return undefined; + } else if (segment == inputPathPlaceholder) { + return inputFilePath; + } else if (segment == outputPathPlaceholder) { + return outputFilePath; + } else { + return segment; + } + }) + .filter((c) => !!c);