From 465bb403a920eab7bf9bc380763243394c3bb014 Mon Sep 17 00:00:00 2001 From: erikp9 Date: Thu, 19 Aug 2021 02:30:22 +0200 Subject: [PATCH] fixed hardsub detection --- src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs | 2 ++ src/NzbDrone.Core/Parser/QualityParser.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index e335b7b2e2..c6b9fd60ce 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -429,6 +429,8 @@ public void should_parse_resolution_from_name_and_source_from_extension(string t [TestCase("Movie.Title.2016.1080p.KORSUBS.WEBRip.x264.AAC2.0-RADARR", "KORSUBS")] [TestCase("Movie Title 2017 HC 720p HDRiP DD5 1 x264-LEGi0N", "Generic Hardcoded Subs")] [TestCase("Movie.Title.2017.720p.SUBBED.HDRip.V2.XViD-26k.avi", "Generic Hardcoded Subs")] + [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)] public void should_parse_hardcoded_subs(string postTitle, string sub) { QualityParser.ParseQuality(postTitle).HardcodedSubs.Should().Be(sub); diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index a7d46b6240..48464163f3 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -77,7 +77,7 @@ public class QualityParser private static readonly Regex HDShitQualityRegex = new Regex(@"(HD-TS|HDTS|HDTSRip|HD-TC|HDTC|HDCAM|HD-CAM)", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex HardcodedSubsRegex = new Regex(@"\b(?(\w+SUBS?)\b)|(?(HC|SUBBED))\b", + private static readonly Regex HardcodedSubsRegex = new Regex(@"\b(?(\w+(?(HC|SUBBED))\b", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); public static QualityModel ParseQuality(string name)