fix(windows): normalize export save path and relax early decode end

This commit is contained in:
Azeru
2026-04-11 17:27:52 +01:00
parent 68295b21ec
commit 08aff31351
2 changed files with 22 additions and 7 deletions
+9 -4
View File
@@ -638,7 +638,6 @@ export function registerIpcHandlers(
return null;
}
});
ipcMain.handle("save-exported-video", async (_, videoData: ArrayBuffer, fileName: string) => {
try {
// Determine file type from extension
@@ -664,11 +663,18 @@ export function registerIpcHandlers(
};
}
await fs.writeFile(result.filePath, Buffer.from(videoData));
// --- FIX: Normalize the path for Windows compatibility ---
const normalizedPath = path.normalize(result.filePath);
// Ensure the parent directory exists (Windows may fail if the folder is missing)
await fs.mkdir(path.dirname(normalizedPath), { recursive: true });
// --- END FIX ---
await fs.writeFile(normalizedPath, Buffer.from(videoData));
return {
success: true,
path: result.filePath,
path: normalizedPath,
message: "Video exported successfully",
};
} catch (error) {
@@ -680,7 +686,6 @@ export function registerIpcHandlers(
};
}
});
ipcMain.handle("open-video-file-picker", async () => {
try {
const result = await dialog.showOpenDialog({