1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-24 15:40:21 +01:00

Fix batch mode upscayl

This commit is contained in:
Nayam Amarshe 2023-11-26 15:48:31 +05:30
parent ab451a4f9d
commit 00520494cd

View File

@ -159,6 +159,7 @@ const batchUpscayl = async (event, payload: BatchUpscaylPayload) => {
} }
}); });
mainWindow.webContents.send(COMMAND.FOLDER_UPSCAYL_DONE, outputDir); mainWindow.webContents.send(COMMAND.FOLDER_UPSCAYL_DONE, outputDir);
fs.rmdirSync(tempDirectory, { recursive: true });
} catch (error) { } catch (error) {
logit("❌ Error processing (scaling and converting) the image.", error); logit("❌ Error processing (scaling and converting) the image.", error);
upscayl.kill(); upscayl.kill();
@ -168,12 +169,12 @@ const batchUpscayl = async (event, payload: BatchUpscaylPayload) => {
"Error processing (scaling and converting) the image. Please report this error on Upscayl GitHub Issues page.\n" + "Error processing (scaling and converting) the image. Please report this error on Upscayl GitHub Issues page.\n" +
error error
); );
fs.rmdirSync(tempDirectory, { recursive: true });
} }
} else { } else {
upscayl.kill(); upscayl.kill();
} }
}; };
upscayl.process.stderr.on("data", onData); upscayl.process.stderr.on("data", onData);
upscayl.process.on("error", onError); upscayl.process.on("error", onError);
upscayl.process.on("close", onClose); upscayl.process.on("close", onClose);