From 4777f2a676c49b5925858351393fa98911ac1e0d Mon Sep 17 00:00:00 2001 From: Zack MacLennan Date: Wed, 3 Nov 2021 19:27:11 -0400 Subject: [PATCH] Updated to include handling for AVC (#193) Added handling for AVC. Lots of my remuxes from Radarr had AVC in the filename as opposed to h264/x264. This replaces the AVC string with HEVC. --- .../Tdarr_Plugin_z18s_rename_files_based_on_codec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js b/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js index 7495de0..1d83aed 100644 --- a/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js +++ b/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js @@ -26,6 +26,15 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { file._id = file._id.replace("264", "265"); file.file = file.file.replace("264", "265"); } + + //added handling for files with AVC in the name instead of h264/x264 + if ( + file.ffProbeData.streams[0].codec_name == "hevc" && + file._id.includes("AVC") + ) { + file._id = file._id.replace("AVC", "HEVC"); + file.file = file.file.replace("AVC", "HEVC"); + } if ( file.ffProbeData.streams[0].codec_name == "h264" &&