The swiss army knife of lossless video/audio editing
set default export save dialog path
Mikael Finstadbe6a2627ae97
diff --git a/src/App.jsx b/src/App.jsxindex db479ab2..aa3ab71b 100644--- a/src/App.jsx+++ b/src/App.jsx@@ -2243,7 +2243,7 @@ const App = memo(() => {async function exportEdlFile2(e, type) {if (!checkFileOpened()) return;try {- await exportEdlFile({ type, cutSegments, filePath, getFrameCount });+ await exportEdlFile({ type, cutSegments, customOutDir, filePath, getFrameCount });} catch (err) {errorToast(i18n.t('Failed to export project'));console.error('Failed to export project', type, err);diff --git a/src/edlStore.js b/src/edlStore.jsindex 32a42ad0..d20120f4 100644--- a/src/edlStore.js+++ b/src/edlStore.js@@ -3,6 +3,7 @@ import i18n from 'i18next';import { parseCuesheet, parseXmeml, parseFcpXml, parseCsv, parsePbf, parseMplayerEdl, formatCsvHuman, formatTsv, formatCsvFrames, formatCsvSeconds, getTimeFromFrameNum } from './edlFormats';import { askForYouTubeInput } from './dialogs';+import { getOutPath } from './util';const fs = window.require('fs-extra');const cueParser = window.require('cue-parser');@@ -101,7 +102,7 @@ export async function askForEdlImport({ type, fps }) {return readEdlFile({ type, path: filePaths[0], fps });}-export async function exportEdlFile({ type, cutSegments, filePath, getFrameCount }) {+export async function exportEdlFile({ type, cutSegments, customOutDir, filePath, getFrameCount }) {let filters;let ext;if (type === 'csv') {@@ -121,7 +122,9 @@ export async function exportEdlFile({ type, cutSegments, filePath, getFrameCountfilters = [{ name: i18n.t('LosslessCut project'), extensions: [ext, 'llc'] }];}- const { canceled, filePath: savePath } = await dialog.showSaveDialog({ defaultPath: `${new Date().getTime()}.${ext}`, filters });+ const defaultPath = getOutPath({ filePath, customOutDir, fileName: `${new Date().getTime()}.${ext}` });++ const { canceled, filePath: savePath } = await dialog.showSaveDialog({ defaultPath, filters });if (canceled || !savePath) return;console.log('Saving', type, savePath);if (type === 'csv') await saveCsv(savePath, cutSegments);