diff --git a/main/index.js b/main/index.js index 21bf718..597c155 100644 --- a/main/index.js +++ b/main/index.js @@ -61,7 +61,9 @@ app.on("ready", async () => { return { action: "deny" }; }); - mainWindow.once("ready-to-show", () => { mainWindow.show(); }) + mainWindow.once("ready-to-show", () => { + mainWindow.show(); + }); if (!isDev) { autoUpdater.checkForUpdates(); @@ -117,18 +119,15 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => { : payload.imagePath.split("/").slice(-1)[0]; const fileName = parse(fullfileName).name; const fileExt = parse(fullfileName).ext; - const outFile = outputDir + "/" + fileName + "_upscayled_" + scale + "x_" + model + fileExt; + const outFile = + outputDir + "/" + fileName + "_upscayled_" + scale + "x_" + model + fileExt; // UPSCALE console.log("PRODUCTION? :", isDev); console.log("EXEC: ", execPath); if (fs.existsSync(outFile)) { - mainWindow.webContents.send( - commands.UPSCAYL_DONE, - outFile - ); - } - else { + mainWindow.webContents.send(commands.UPSCAYL_DONE, outFile); + } else { let upscayl = spawn( execPath, [ @@ -148,6 +147,7 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => { detached: false, } ); + let failed = false; upscayl.stderr.on("data", (stderr) => { console.log(stderr.toString()); @@ -157,18 +157,17 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => { } mainWindow.webContents.send(commands.UPSCAYL_PROGRESS, stderr.toString()); }); + upscayl.on("close", (code) => { if (failed !== true) { console.log("Done upscaling"); - mainWindow.webContents.send( - commands.UPSCAYL_DONE, - outFile - ); + mainWindow.webContents.send(commands.UPSCAYL_DONE, outFile); } }); } }); +// ! AUTO UPDATE STUFF autoUpdater.on("update-available", (_event, releaseNotes, releaseName) => { const dialogOpts = { type: "info", diff --git a/package.json b/package.json index df7a477..bf19c90 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "upscayl", "private": true, - "version": "1.2.0", + "version": "1.3.0", "productName": "Upscayl", "homepage": "https://github.com/TGS963/upscayl", "contributors": [ diff --git a/renderer/pages/index.jsx b/renderer/pages/index.jsx index 84cd0df..01f37d3 100644 --- a/renderer/pages/index.jsx +++ b/renderer/pages/index.jsx @@ -101,7 +101,7 @@ const Home = () => { SetImagePath(filePath); var dirname = filePath.match(/(.*)[\/\\]/)[1] || ""; SetOutputPath(dirname); - window.electron.invoke(commands.SET_FILE, {original: filePath}); + window.electron.invoke(commands.SET_FILE, { original: filePath }); } }; @@ -173,14 +173,14 @@ const Home = () => {

Step 1

{/* STEP 2 */} -
+

Step 2

Select Upscaling Type @@ -188,7 +188,7 @@ const Home = () => {