Skip to content

The swiss army knife of lossless video/audio editing

improve feedback

Mikael Finstadd91ca6373aa5
diff --git a/src/renderer.jsx b/src/renderer.jsx
index 23d73fe8..cdd96b96 100644
--- a/src/renderer.jsx
+++ b/src/renderer.jsx
@@ -30,7 +30,7 @@ const ffmpeg = require('./ffmpeg');
const {
getOutPath, parseDuration, formatDuration, toast, errorToast, showFfmpegFail, setFileNameTitle,
- promptTimeOffset, generateColor,
+ promptTimeOffset, generateColor, getOutDir,
} = require('./util');
const { dialog } = electron.remote;
@@ -417,6 +417,7 @@ const App = memo(() => {
showFfmpegFail(err);
} finally {
+ toast.fire({ timer: 10000, type: 'success', title: `Cut completed! Output file(s) can be found at: ${getOutDir(customOutDir, filePath)}. You can change the output directory in settings` });
setWorking(false);
}
}, [
diff --git a/src/util.js b/src/util.js
index 23a21a4b..8a587578 100644
--- a/src/util.js
+++ b/src/util.js
@@ -36,12 +36,15 @@ function parseDuration(str) {
return ((((hours * 60) + minutes) * 60) + seconds) + (ms / 1000);
}
+function getOutDir(customOutDir, filePath) {
+ const dirname = path.dirname(filePath);
+ return customOutDir || dirname;
+}
+
function getOutPath(customOutDir, filePath, nameSuffix) {
const basename = path.basename(filePath);
- return customOutDir
- ? path.join(customOutDir, `${basename}-${nameSuffix}`)
- : `${filePath}-${nameSuffix}`;
+ return path.join(getOutDir(customOutDir, filePath), `${basename}-${nameSuffix}`);
}
async function transferTimestamps(inPath, outPath) {
@@ -114,6 +117,7 @@ module.exports = {
formatDuration,
parseDuration,
getOutPath,
+ getOutDir,
transferTimestamps,
transferTimestampsWithOffset,
toast,