1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-14 10:47:56 +01:00

Refactor file path and remove unnecessary code

This commit is contained in:
Nayam Amarshe 2024-01-15 18:20:36 +05:30
parent a80f85a069
commit 3ed4638aa5

View File

@ -141,18 +141,13 @@ const batchUpscayl = async (event, payload: BatchUpscaylPayload) => {
`${outputFolderPath}${slash}${removeFileExtension( `${outputFolderPath}${slash}${removeFileExtension(
file file
)}.${saveImageAs}`, )}.${saveImageAs}`,
`${outputFolderPath}/${removeFileExtension(file)}.${saveImageAs}`, `${outputFolderPath}${slash}${removeFileExtension(
file
)}.${saveImageAs}`,
desiredScale, desiredScale,
saveImageAs, saveImageAs,
onError onError
); );
// Remove the png file (default) if the saveImageAs is not png
if (saveImageAs !== "png") {
logit("Removing output PNG");
fs.unlinkSync(
`${outputFolderPath}${slash}${removeFileExtension(file)}.png`
);
}
}); });
mainWindow.webContents.send( mainWindow.webContents.send(
COMMAND.FOLDER_UPSCAYL_DONE, COMMAND.FOLDER_UPSCAYL_DONE,