1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-28 01:10:52 +01:00
upscayl/electron/commands/get-models-list.ts
2023-09-11 08:37:07 +05:30

27 lines
663 B
TypeScript

import COMMAND from "../constants/commands";
import { getMainWindow } from "../main-window";
import {
customModelsFolderPath,
setCustomModelsFolderPath,
} from "../utils/config-variables";
import getModels from "../utils/get-models";
import logit from "../utils/logit";
const getModelsList = async (event, payload) => {
const mainWindow = getMainWindow();
if (!mainWindow) return;
if (payload) {
setCustomModelsFolderPath(payload);
logit("📁 Custom Models Folder Path: ", customModelsFolderPath);
mainWindow.webContents.send(
COMMAND.CUSTOM_MODEL_FILES_LIST,
getModels(payload)
);
}
};
export default getModelsList;