version 2 of trying to get the module names

This commit is contained in:
2025-11-24 14:13:09 +01:00
parent 6531f5f51c
commit 9082543652
3 changed files with 12 additions and 10 deletions
+5 -5
View File
@@ -11,13 +11,13 @@ try {
getFilePath: (file) => {return webUtils.getPathForFile(file)}
})
contextBridge.exposeInMainWorld("onStartup", {
getModuleNames: (file) => { ipcRenderer.send("get_modules", "")}
getModuleNames: () => ipcRenderer.invoke('get-module-names')
})
ipcRenderer.on("modules", (event, resp) => {
loadAiOptions(resp.ai_modules);
loadTranscriptionOptions(resp.transcription_modules);
})
// ipcRenderer.on("modules", (event, resp) => {
// loadAiOptions(resp.ai_modules);
// loadTranscriptionOptions(resp.transcription_modules);
// })
} catch (error) {
console.log("Error in preload.js");
}
+5 -3
View File
@@ -31,12 +31,14 @@ uploadContainer.addEventListener("drop", (e) => {
}
})
window.addEventListener('load', (e) => {
window.addEventListener('load', async (e) => {
try {
console.log("test");
loadLanguageOptions();
window.onStartup.getModuleNames();
const value = await window.onStartup.getModuleNames();
loadAiOptions(value.ai_modules);
loadTranscriptionOptions(value.transcription_modules);
} catch (error) {
}
+2 -2
View File
@@ -43,7 +43,7 @@ function checkBoxes() {
const aiType = document.getElementById("ai_type");
const sendingPackage = {
"video": {
"module":"extraction-video-toaudio",
"module":"extraction-video-to-audio",
"inputVideoPath": pathTest,
"outputType": outputType.value
},
@@ -52,7 +52,7 @@ function checkBoxes() {
},
"document": {
"module":aiType.value,
"style": selectedStyles
"styles": selectedStyles
}
};
ipcRenderer.send("file_submit", sendingPackage)