Improve --keepAllVideos

Fixes issue where in not all cases keepAllVideos would work
This commit is contained in:
AnimeDL 2023-07-16 13:24:11 -07:00
parent 02b4385db3
commit 5962c556ec

View file

@ -68,7 +68,7 @@ class Merger {
for (const vid of this.options.videoAndAudio) {
args.push(`-i "${vid.path}"`);
if (!hasVideo) {
if (!hasVideo || this.options.keepAllVideos) {
metaData.push(`-map ${index}:a -map ${index}:v`);
metaData.push(`-metadata:s:a:${audioIndex} language=${vid.lang.code}`);
metaData.push(`-metadata:s:v:${index} title="${this.options.videoTitle}"`);
@ -82,7 +82,7 @@ class Merger {
}
for (const vid of this.options.onlyVid) {
if (!hasVideo) {
if (!hasVideo || this.options.keepAllVideos) {
args.push(`-i "${vid.path}"`);
metaData.push(`-map ${index} -map -${index}:a`);
metaData.push(`-metadata:s:v:${index} title="${this.options.videoTitle}"`);
@ -148,7 +148,7 @@ class Merger {
args.push(...this.options.options.mkvmerge);
for (const vid of this.options.onlyVid) {
if (!hasVideo) {
if (!hasVideo || this.options.keepAllVideos) {
args.push(
'--video-tracks 0',
'--no-audio'