mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-22 10:22:31 +01:00
improve feedback
This commit is contained in:
parent
4109c7c1cd
commit
d91ca6373a
@ -30,7 +30,7 @@ const ffmpeg = require('./ffmpeg');
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
getOutPath, parseDuration, formatDuration, toast, errorToast, showFfmpegFail, setFileNameTitle,
|
getOutPath, parseDuration, formatDuration, toast, errorToast, showFfmpegFail, setFileNameTitle,
|
||||||
promptTimeOffset, generateColor,
|
promptTimeOffset, generateColor, getOutDir,
|
||||||
} = require('./util');
|
} = require('./util');
|
||||||
|
|
||||||
const { dialog } = electron.remote;
|
const { dialog } = electron.remote;
|
||||||
@ -417,6 +417,7 @@ const App = memo(() => {
|
|||||||
|
|
||||||
showFfmpegFail(err);
|
showFfmpegFail(err);
|
||||||
} finally {
|
} 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);
|
setWorking(false);
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
|
10
src/util.js
10
src/util.js
@ -36,12 +36,15 @@ function parseDuration(str) {
|
|||||||
return ((((hours * 60) + minutes) * 60) + seconds) + (ms / 1000);
|
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) {
|
function getOutPath(customOutDir, filePath, nameSuffix) {
|
||||||
const basename = path.basename(filePath);
|
const basename = path.basename(filePath);
|
||||||
|
|
||||||
return customOutDir
|
return path.join(getOutDir(customOutDir, filePath), `${basename}-${nameSuffix}`);
|
||||||
? path.join(customOutDir, `${basename}-${nameSuffix}`)
|
|
||||||
: `${filePath}-${nameSuffix}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function transferTimestamps(inPath, outPath) {
|
async function transferTimestamps(inPath, outPath) {
|
||||||
@ -114,6 +117,7 @@ module.exports = {
|
|||||||
formatDuration,
|
formatDuration,
|
||||||
parseDuration,
|
parseDuration,
|
||||||
getOutPath,
|
getOutPath,
|
||||||
|
getOutDir,
|
||||||
transferTimestamps,
|
transferTimestamps,
|
||||||
transferTimestampsWithOffset,
|
transferTimestampsWithOffset,
|
||||||
toast,
|
toast,
|
||||||
|
Loading…
Reference in New Issue
Block a user