diff --git a/src/ffmpeg.js b/src/ffmpeg.js index 367d401e..cc030ec1 100644 --- a/src/ffmpeg.js +++ b/src/ffmpeg.js @@ -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 }); } /** diff --git a/src/renderer.jsx b/src/renderer.jsx index e6da209f..83184108 100644 --- a/src/renderer.jsx +++ b/src/renderer.jsx @@ -786,7 +786,7 @@ class App extends React.Component {