concatDemuxer implemented

This commit is contained in:
santosh898
2019-12-16 15:30:44 +05:30
parent f93ae84794
commit 68fd03d55d
4 changed files with 60 additions and 70 deletions

View File

@@ -66,7 +66,9 @@ const ls = ({
const run = async ({
payload: {
args: _args,
options: { inputPath, outputPath, del },
options: {
inputPath, inputPaths, outputPath, del,
},
},
}, res) => {
const args = [...defaultArgs, ..._args.trim().split(' ')];
@@ -75,6 +77,9 @@ const run = async ({
Module.FS.unlink(outputPath);
if (del && typeof inputPath === 'string') {
await adapter.fs.deleteFile(inputPath);
} else if (del && Array.isArray(inputPaths)) {
inputPaths.reduce((promise, input) => promise.then(() => adapter.fs.deleteFile(input)),
Promise.resolve());
}
res.resolve({ message: `Complete ${args.join(' ')}` });
};