mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-13 17:30:27 -07:00
Merge pull request #404 from HaveAGitGat/remove_stream_fix
Convert non=string to string for comparsion, add test
This commit is contained in:
commit
5a47a13501
2 changed files with 22 additions and 1 deletions
|
|
@ -76,7 +76,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
|
||||||
let streamToRemove = false;
|
let streamToRemove = false;
|
||||||
for (let i = 0; i < file.ffProbeData.streams.length; i += 1) {
|
for (let i = 0; i < file.ffProbeData.streams.length; i += 1) {
|
||||||
try {
|
try {
|
||||||
if (valuesToRemove.includes(file.ffProbeData.streams[i][propertyToCheck])) {
|
if (valuesToRemove.includes(String(file.ffProbeData.streams[i][propertyToCheck]))) {
|
||||||
response.preset += ` -map -0:${i} `;
|
response.preset += ` -map -0:${i} `;
|
||||||
response.infoLog += ` Removing stream ${i} which is has ${propertyToCheck}`
|
response.infoLog += ` Removing stream ${i} which is has ${propertyToCheck}`
|
||||||
+ ` of ${file.ffProbeData.streams[i][propertyToCheck]} \n`;
|
+ ` of ${file.ffProbeData.streams[i][propertyToCheck]} \n`;
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,27 @@ const tests = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
input: {
|
||||||
|
file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')),
|
||||||
|
librarySettings: {},
|
||||||
|
inputs: {
|
||||||
|
propertyToCheck: 'level',
|
||||||
|
valuesToRemove: '41',
|
||||||
|
},
|
||||||
|
otherArguments: {},
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
processFile: true,
|
||||||
|
preset: ', -map 0 -c copy -max_muxing_queue_size 9999 -map -0:0 ',
|
||||||
|
container: '.mkv',
|
||||||
|
handBrakeMode: false,
|
||||||
|
FFmpegMode: true,
|
||||||
|
reQueueAfter: false,
|
||||||
|
infoLog: ' Removing stream 0 which is has level of 41 \n'
|
||||||
|
+ ' Files has streams which need to be removed, processing \n',
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
run(tests);
|
run(tests);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue