From 36f66eed21a9ae2e3b3b3ecdea6f0201c87a962a Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 24 Oct 2018 20:13:57 -0700 Subject: [PATCH] New: Parse names with 4k as 2160p Closes #2788 --- src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs | 7 +++++++ src/NzbDrone.Core/Parser/QualityParser.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index 954e94605..124836e1d 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -135,6 +135,13 @@ namespace NzbDrone.Core.Test.ParserTests ParseAndVerifyQuality(title, Quality.HDTV1080p, proper); } + [TestCase("My Title - S01E01 - EpTitle [HEVC 4k DTSHD-MA-6ch]", false)] + [TestCase("My Title - S01E01 - EpTitle [HEVC-4k DTSHD-MA-6ch]", false)] + public void should_parse_hdtv2160p_quality(string title, bool proper) + { + ParseAndVerifyQuality(title, Quality.HDTV2160p, proper); + } + [TestCase("Arrested.Development.S04E01.720p.WEBRip.AAC2.0.x264-NFRiP", false)] [TestCase("Vanguard S01E04 Mexicos Death Train 720p WEB DL", false)] [TestCase("Hawaii Five 0 S02E21 720p WEB DL DD5 1 H 264", false)] diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index a020b4d84..c4611d141 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -40,7 +40,7 @@ namespace NzbDrone.Core.Parser private static readonly Regex RealRegex = new Regex(@"\b(?REAL)\b", RegexOptions.Compiled); - private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?480p|640x480|848x480)|(?576p)|(?720p|1280x720)|(?1080p|1920x1080|1440p)|(?2160p|4k[-_. ]UHD|UHD[-_. ]4k))\b", + private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?480p|640x480|848x480)|(?576p)|(?720p|1280x720)|(?1080p|1920x1080|1440p)|(?2160p|4k[-_. ]UHD|UHD[-_. ]4k|[-_. ]4k))\b", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex CodecRegex = new Regex(@"\b(?:(?x264)|(?h264)|(?XvidHD)|(?Xvid)|(?divx))\b",