From 2b6f908038e982d770a8159f3c800bd879866b47 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 8 Jul 2014 22:45:19 -0700 Subject: [PATCH] New: HR WS PDTV releases will be treated as HDTV720p --- .../ParserTests/QualityParserFixture.cs | 2 ++ src/NzbDrone.Core/Parser/QualityParser.cs | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index 98e0a5bf0..797960fc6 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -106,6 +106,8 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("[Doremi].Yes.Pretty.Cure.5.Go.Go!.31.[1280x720].[C65D4B1F].mkv", false)] [TestCase("[HorribleSubs]_Fairy_Tail_-_145_[720p]", false)] [TestCase("[Eveyuu] No Game No Life - 10 [Hi10P 1280x720 H264][10B23BD8]", false)] + [TestCase("Hells.Kitchen.US.S12E17.HR.WS.PDTV.X264-DIMENSION", false)] + [TestCase("Survivorman.The.Lost.Pilots.Summer.HR.WS.PDTV.x264-DHD", false)] public void should_parse_hdtv720p_quality(string title, bool proper) { ParseAndVerifyQuality(title, Quality.HDTV720p, proper); diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index edc8755d6..4a7a336c8 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -41,6 +41,8 @@ namespace NzbDrone.Core.Parser private static readonly Regex AnimeBlurayRegex = new Regex(@"bd(?:720|1080)|(?<=\[|\(|\s)bd(?=\s|\)|\])", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private static readonly Regex HighDefPdtvRegex = new Regex(@"hr[-_. ]ws", RegexOptions.Compiled | RegexOptions.IgnoreCase); + public static QualityModel ParseQuality(string name) { Logger.Debug("Trying to parse quality for {0}", name); @@ -163,6 +165,12 @@ namespace NzbDrone.Core.Parser sourceMatch.Groups["sdtv"].Success || sourceMatch.Groups["dsr"].Success) { + if (HighDefPdtvRegex.IsMatch(normalizedName)) + { + result.Quality = Quality.HDTV720p; + return result; + } + result.Quality = Quality.SDTV; return result; }