From e4d0ea0207ea37574174e4d3fa4ab7000cffceaa Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 21 Mar 2022 21:27:47 +0100 Subject: [PATCH] Fix ffmpeg bug (doesn't move image streams) (#282) --- ...rr_Plugin_00td_action_re_order_all_streams_v2.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js index dd70a36..c99931b 100644 --- a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js +++ b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -111,9 +111,16 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { const matchedStreams = []; for (let j = 0; j < streams.length; j += 1) { if (String(sortType.getValue(streams[j])).includes(String(items[i]))) { - matchedStreams.push(streams[j]); - streams.splice(j, 1); - j -= 1; + if ( + streams[j].codec_long_name + && streams[j].codec_long_name.includes('image') + ) { + // do nothing, ffmpeg bug, doesn't move image streams + } else { + matchedStreams.push(streams[j]); + streams.splice(j, 1); + j -= 1; + } } } streams = matchedStreams.concat(streams);