From 740b258ce12f3256b07c5c23b152d6f917fd81eb Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 4 Apr 2024 12:33:48 +0200 Subject: [PATCH] fix two pass files location --- src/main.ts | 2 +- src/utils/misc.ts | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index ad21faf..1d8a3d3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -200,7 +200,7 @@ app.whenReady().then(() => { deleteFile(file); // Delete the 2 pass temporary files - deleteTwoPassFiles(file); + deleteTwoPassFiles(process.cwd()); return finalFile; }; diff --git a/src/utils/misc.ts b/src/utils/misc.ts index b4552b5..95d66d2 100644 --- a/src/utils/misc.ts +++ b/src/utils/misc.ts @@ -47,11 +47,8 @@ export const deleteFile = (file: string) => { }); }; -/** Delete the 2pass files generated by ffmpeg, we're using - * the file location to know in which directory they are. - * We're checking first if they exists where we are looking at. */ -export const deleteTwoPassFiles = (file: string) => { - const directory = path.parse(file).dir; +/** Delete the 2pass files generated by ffmpeg */ +export const deleteTwoPassFiles = (directory: string) => { const logFile = path.join(directory, "ffmpeg2pass-0.log"); if (existsSync(logFile)) {