From 8927b62971550252291507d7f729e75146050640 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Dec 2025 18:17:55 +0100 Subject: [PATCH] some more cleanup --- main.js | 47 +++++++++++++---------------------------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/main.js b/main.js index 68c16a1..ac2a135 100644 --- a/main.js +++ b/main.js @@ -132,7 +132,7 @@ electron.ipcMain.on("file_submit", async (event, args) => { globalArgs = args let curstep = 0 let totalsteps = 4 - + const TEMPLATE_MAP = { "followup-report": "followup_report.txt", "agenda": "agenda.txt", @@ -140,9 +140,9 @@ electron.ipcMain.on("file_submit", async (event, args) => { "sprint-planning": "sprint_planning_note.txt", "custom": "custom_document.txt" }; - + const templateFile = TEMPLATE_MAP[args.document.type]; - + if (!templateFile) { throw new Error("Unknown document type: " + args.document.type); } @@ -196,17 +196,17 @@ electron.ipcMain.on("file_submit", async (event, args) => { // This code handles the Text to Document processing module call console.log(`\n\n Running the LLM for Document Style ${args.document.type}`); - + await mapFunctions.get("module-handler").function(args.document.module, { inputTranscriptPath: transcriptpath, documentTypePath: "./storage/documentType/" + templateFile, language: "en" }).then(resp => { - console.log(resp); - globalFinalHtmlPath = resp - curstep++ - mainWindow.webContents.send("progress", {curstep:curstep, totalsteps:totalsteps}) - }).catch(err => { - mainWindow.webContents.send("error", err) - return - }) - + console.log(resp); + globalFinalHtmlPath = resp + curstep++ + mainWindow.webContents.send("progress", {curstep:curstep, totalsteps:totalsteps}) + }).catch(err => { + mainWindow.webContents.send("error", err) + return + }) + await mapFunctions.get("extract-speaker-snippets").function({audioPath: audiopath, jsonPath: transcriptpath }).then(resp => { mainWindow.webContents.send("submitSpeaker", resp) @@ -215,27 +215,6 @@ electron.ipcMain.on("file_submit", async (event, args) => { mainWindow.webContents.send("error", err) return }) - - - // TODO actually implement this functionality - // Module to get the first few lines for each speaker to send to the frontend -// await mapFunctions.get("speaker-getter-idfk").function(transcriptpath).then(resp => { -// console.log(resp); -// transcriptpath = resp -// curstep++ -// mainWindow.webContents.send("progress", {curstep:curstep, totalsteps:totalsteps}) - -// // { -// // speakerA: {source: "Pfad zur Audio File"}, -// // speakerB:..... -// // } -// mainWindow.webContents.send("speakers", {speakerA:"pfad1", speakerB:"pfad2"}) -// }).catch(err => { -// mainWindow.webContents.send("error", err) -// return -// }) - - } catch (error) { console.log(error); }