mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-21 18:02:35 +01:00
Auto delete segments on merge #147
This commit is contained in:
parent
ed3fcadf2f
commit
397b8b6bf8
@ -9,6 +9,7 @@ const sum = require('lodash/sum');
|
||||
const readline = require('readline');
|
||||
const moment = require('moment');
|
||||
const stringToStream = require('string-to-stream');
|
||||
const trash = require('trash');
|
||||
|
||||
const { formatDuration, getOutPath, transferTimestamps } = require('./util');
|
||||
|
||||
@ -211,7 +212,8 @@ async function mergeAnyFiles(paths) {
|
||||
async function autoMergeSegments({ customOutDir, sourceFile, segmentPaths }) {
|
||||
const ext = path.extname(sourceFile);
|
||||
const outPath = getOutPath(customOutDir, sourceFile, `cut-merged-${new Date().getTime()}${ext}`);
|
||||
return mergeFiles(segmentPaths, outPath);
|
||||
await mergeFiles(segmentPaths, outPath);
|
||||
await bluebird.map(segmentPaths, trash, { concurrency: 5 });
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -786,7 +786,7 @@ class App extends React.Component {
|
||||
|
||||
<button
|
||||
type="button"
|
||||
title={`Auto merge segments to one file after export? ${autoMerge ? 'Auto merge enabled' : 'No merging'}`}
|
||||
title={`Auto merge segments to one file after export (and trash segments)? ${autoMerge ? 'Auto merge enabled' : 'No merging'}`}
|
||||
onClick={withBlur(this.toggleAutoMerge)}
|
||||
>
|
||||
{autoMerge ? 'am' : 'nm'}
|
||||
|
Loading…
Reference in New Issue
Block a user