From d3a0c83f98cd264f736e5c31874e68a4521f32e1 Mon Sep 17 00:00:00 2001 From: namakeingo Date: Sun, 25 Aug 2024 22:57:52 +0100 Subject: [PATCH] Fixed: False positive HC for MultiSubs (#10024) * Fixed: Multisubs wrongly detected as hardcoded As flagged by multiple people before "Multisubs" is a commonly used Tag that indicates that the file has more than 3 subtitle languages. Multisubs never indicate a hardcoded sub as you cannot have a multisubs where you can select between different languages if the subtitles are hardcoded in the video. This minor change excludes "MULTISUBS" from the regex used. --- src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs | 1 + src/NzbDrone.Core/Parser/Parser.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs index 8283f73a9..b4cdf7791 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -272,6 +272,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("Movie.Title.2000.1080p.BlueRay.x264.DTS.RoSubbed-playHD", null)] [TestCase("Movie Title! 2018 [Web][MKV][h264][480p][AAC 2.0][Softsubs]", null)] [TestCase("Movie Title! 2019 [HorribleSubs][Web][MKV][h264][848x480][AAC 2.0][Softsubs(HorribleSubs)]", null)] + [TestCase("Movie Title! 2024 [Web][x265][1080p][EAC3][MultiSubs]", null)] public void should_parse_hardcoded_subs(string postTitle, string sub) { Parser.Parser.ParseMovieTitle(postTitle).HardcodedSubs.Should().Be(sub); diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index ec7d1ad54..57612e437 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -18,7 +18,7 @@ namespace NzbDrone.Core.Parser private static readonly Regex ReportEditionRegex = new Regex(@"^.+?" + EditionRegex, RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex HardcodedSubsRegex = new Regex(@"\b((?(\w+(?(HC|SUBBED)))\b", + private static readonly Regex HardcodedSubsRegex = new Regex(@"\b((?(\w+(?(HC|SUBBED)))\b", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); private static readonly RegexReplace[] PreSubstitutionRegex = Array.Empty();