fix two pass files location

This commit is contained in:
Mylloon 2024-04-04 12:33:48 +02:00
parent a3f4c077ef
commit 740b258ce1
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 3 additions and 6 deletions

View file

@ -200,7 +200,7 @@ app.whenReady().then(() => {
deleteFile(file);
// Delete the 2 pass temporary files
deleteTwoPassFiles(file);
deleteTwoPassFiles(process.cwd());
return finalFile;
};

View file

@ -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)) {