diff --git a/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js b/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js index bd7d236..fac55d4 100644 --- a/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js +++ b/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js @@ -76,7 +76,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let streamToRemove = false; for (let i = 0; i < file.ffProbeData.streams.length; i += 1) { try { - if (valuesToRemove.includes(file.ffProbeData.streams[i][propertyToCheck])) { + if (valuesToRemove.includes(String(file.ffProbeData.streams[i][propertyToCheck]))) { response.preset += ` -map -0:${i} `; response.infoLog += ` Removing stream ${i} which is has ${propertyToCheck}` + ` of ${file.ffProbeData.streams[i][propertyToCheck]} \n`; diff --git a/tests/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js b/tests/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js index 09e16c8..ca950c1 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js +++ b/tests/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js @@ -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);