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

Removed redundant variables

This commit is contained in:
Nayam Amarshe 2024-04-25 01:22:17 +05:30
parent 3f76011ba5
commit 1b947d82c1
3 changed files with 15 additions and 77 deletions

View File

@ -17,7 +17,6 @@ export function sanitizePath(filePath: string) {
// Combine the protocol prefix with the encoded file path to create the final file URL // Combine the protocol prefix with the encoded file path to create the final file URL
const fileUrl = encodedFilePath; const fileUrl = encodedFilePath;
console.log("🚀 => fileUrl:", fileUrl);
// Return the final Electron file URL // Return the final Electron file URL
return fileUrl; return fileUrl;

View File

@ -22,56 +22,38 @@ export function setSavedBatchUpscaylFolderPath(
logit("📁 Updating Folder Path: ", savedBatchUpscaylFolderPath); logit("📁 Updating Folder Path: ", savedBatchUpscaylFolderPath);
} }
/**
* The saved custom models folder path so that we can load the list of custom models from that folder on startup.
*/
export let savedCustomModelsPath: string | undefined = undefined; export let savedCustomModelsPath: string | undefined = undefined;
export function setSavedCustomModelsPath(value: string | undefined): void { export function setSavedCustomModelsPath(value: string | undefined): void {
savedCustomModelsPath = value; savedCustomModelsPath = value;
logit("📁 Updating Custom Models Folder Path: ", savedCustomModelsPath); logit("📁 Updating Custom Models Folder Path: ", savedCustomModelsPath);
} }
export let savedOutputPath: string | undefined = undefined; /**
export function setSavedOutputPath(value: string | undefined): void { * The stopped variable to stop the batch upscayl process.
savedOutputPath = value; */
logit("📁 Updating Output Folder Path: ", savedOutputPath);
}
export let rememberOutputFolder = false;
export function setRememberOutputFolder(value: boolean): void {
rememberOutputFolder = value;
logit("💾 Updating Remember Output Folder: ", rememberOutputFolder);
}
export let stopped = false; export let stopped = false;
/**
* The child processes array to store the spawned upscayl processes.
*/
export let childProcesses: { export let childProcesses: {
process: ChildProcessWithoutNullStreams; process: ChildProcessWithoutNullStreams;
kill: () => boolean; kill: () => boolean;
}[] = []; }[] = [];
export let noImageProcessing: boolean = false; /**
export function setNoImageProcessing(value: boolean): void { * The turn off notifications variable, so that we can load this value on startup.
noImageProcessing = value; */
logit("🖼️ Updating No Image Processing: ", noImageProcessing);
}
export let turnOffNotifications: boolean = false; export let turnOffNotifications: boolean = false;
export function setTurnOffNotifications(value: boolean): void { export function setTurnOffNotifications(value: boolean): void {
turnOffNotifications = value; turnOffNotifications = value;
logit("🔕 Updating Turn Off Notifications: ", turnOffNotifications); logit("🔕 Updating Turn Off Notifications: ", turnOffNotifications);
} }
// export let customWidth: string | null = null;
// export function setCustomWidth(value: string | null): void {
// customWidth = value;
// logit("📏 Updating Custom Width: ", customWidth);
// }
// export let useCustomWidth: boolean = false;
// export function setUseCustomWidth(value: boolean): void {
// useCustomWidth = value;
// logit("📏 Updating Use Custom Width: ", useCustomWidth);
// }
// SETTERS // SETTERS
export function setStopped(value: boolean): void { export function setStopped(value: boolean): void {
stopped = value; stopped = value;
logit("🛑 Updating Stopped: ", stopped); logit("🛑 Updating Stopped: ", stopped);
@ -126,31 +108,6 @@ export function fetchLocalStorage(): void {
setSavedCustomModelsPath(value); setSavedCustomModelsPath(value);
} }
}); });
// GET LAST CUSTOM MODELS FOLDER PATH TO LOCAL STORAGE
mainWindow.webContents
.executeJavaScript('localStorage.getItem("savedOutputPath");', true)
.then((savedOutputPath: string | null) => {
if (savedOutputPath && savedOutputPath.length > 0) {
setSavedOutputPath(savedOutputPath);
}
});
// GET LAST SAVE OUTPUT FOLDER (BOOLEAN) TO LOCAL STORAGE
mainWindow.webContents
.executeJavaScript('localStorage.getItem("rememberOutputFolder");', true)
.then((lastSaveOutputFolder: boolean | null) => {
if (lastSaveOutputFolder !== null) {
setRememberOutputFolder(lastSaveOutputFolder);
}
});
// GET PROCESS IMAGE (BOOLEAN) FROM LOCAL STORAGE
mainWindow.webContents
.executeJavaScript('localStorage.getItem("noImageProcessing");', true)
.then((lastSaved: string | null) => {
if (lastSaved !== null) {
setNoImageProcessing(lastSaved === "true");
}
});
// GET TURN OFF NOTIFICATIONS (BOOLEAN) FROM LOCAL STORAGE // GET TURN OFF NOTIFICATIONS (BOOLEAN) FROM LOCAL STORAGE
mainWindow.webContents mainWindow.webContents
@ -160,22 +117,4 @@ export function fetchLocalStorage(): void {
setTurnOffNotifications(lastSaved === "true"); setTurnOffNotifications(lastSaved === "true");
} }
}); });
// // GET CUSTOM WIDTH (STRING) FROM LOCAL STORAGE
// mainWindow.webContents
// .executeJavaScript('localStorage.getItem("customWidth");', true)
// .then((lastSaved: string | null) => {
// if (lastSaved !== null) {
// setCustomWidth(lastSaved);
// }
// });
// // GET USE CUSTOM WIDTH (BOOLEAN) FROM LOCAL STORAGE
// mainWindow.webContents
// .executeJavaScript('localStorage.getItem("useCustomWidth");', true)
// .then((lastSaved: string | null) => {
// if (lastSaved !== null) {
// setUseCustomWidth(lastSaved === "true");
// }
// });
} }

View File

@ -155,8 +155,8 @@ const Logo = ({ ...rest }) => {
y2="245.417" y2="245.417"
gradientUnits="userSpaceOnUse" gradientUnits="userSpaceOnUse"
> >
<stop stop-color="#87BDFF" /> <stop stopColor="#87BDFF" />
<stop offset="0.970833" stop-color="#4791CE" /> <stop offset="0.970833" stopColor="#4791CE" />
</linearGradient> </linearGradient>
<clipPath id="clip0_1263_67"> <clipPath id="clip0_1263_67">
<rect width="256" height="256" fill="white" /> <rect width="256" height="256" fill="white" />