Merge commit '6531f5f51c125b9cef761b457ab09f494c77a7e7' into feature/modular-ipc-system-implementation

This commit is contained in:
2025-11-24 12:56:21 +01:00
3 changed files with 30 additions and 44 deletions
+14 -25
View File
@@ -5,39 +5,28 @@ try {
onFileDrop: (file) => webUtils.getPathForFile(file)
})
contextBridge.exposeInMainWorld("extractor", {
extract: (file) => {
let q = // TODO get rid of this example code and have the actual json object be sent
{
video: {
module: "extraction-video-to-audio", // The name of the module, idk if we ever implement other extraction modules, the default one is extraction-video-to-audio
inputVideoPath: file.inputVideoPath, // See script.js on line 27 for an example of what this should look like
outputType: file.outputType // The file format to be used for the audio output file, such as wav, mp3, flac and so on
},
transcription:{
module: "String" // The module name of the transcription model you want to use
},
document:{
module: "String", // The module name of the AI model you want to use to create the document
styles: [ // An array of all the document styles/prompts you want to have the document be processed with
{
prompt: "String",
}
]
}
}
// ipcRenderer.send("file_submit", {module:"extraction-video-to-audio", parameter:file})
ipcRenderer.send("file_submit", q)
}
// extract: (file) => {ipcRenderer.send("file_submit", q)}
})
contextBridge.exposeInMainWorld("electronAPI", {
getFilePath: (file) => {return webUtils.getPathForFile(file)}
})
contextBridge.exposeInMainWorld("onStartup", {
getModuleNames: (file) => { ipcRenderer.send("get_modules", "")}
})
ipcRenderer.on("progress", (event, resp) => {
alert(`Finished step ${resp.curstep} of ${resp.totalsteps}`)
})
ipcRenderer.on("error", (event, err) => {alert(err)})
ipcRenderer.on("modules", (event, resp) => {
loadAiOptions(resp.ai_modules);
loadTranscriptionOptions(resp.transcription_modules);
})
} catch (error) {
console.log("Error in preload.js");
}
}