From bb3ca998fcca5ffb3cf9371726925f919ae0ab88 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 3 Nov 2018 11:30:41 -0700 Subject: [PATCH] Restrict 4k parsing to avoid false positives --- 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 124836e1d..25cb57cf7 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -137,6 +137,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("My Title - S01E01 - EpTitle [HEVC 4k DTSHD-MA-6ch]", false)] [TestCase("My Title - S01E01 - EpTitle [HEVC-4k DTSHD-MA-6ch]", false)] + [TestCase("My Title - S01E01 - EpTitle [4k HEVC DTSHD-MA-6ch]", false)] public void should_parse_hdtv2160p_quality(string title, bool proper) { ParseAndVerifyQuality(title, Quality.HDTV2160p, proper); @@ -239,6 +240,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("House.of.Cards.US.s05e13.4K.UHD.Bluray", false)] [TestCase("House.of.Cards.US.s05e13.UHD.4K.Bluray", false)] + [TestCase("[DameDesuYo] Backlog Bundle - Part 1 (BD 4K 8bit FLAC)", false)] public void should_parse_bluray2160p_quality(string title, bool proper) { ParseAndVerifyQuality(title, Quality.Bluray2160p, proper); diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index c4611d141..c99cff9f4 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|[-_. ]4k))\b", + private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?480p|640x480|848x480)|(?576p)|(?720p|1280x720)|(?1080p|1920x1080|1440p)|(?2160p|4k[-_. ](?:UHD|HEVC|BD)|(?:UHD|HEVC|BD)[-_. ]4k))\b", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex CodecRegex = new Regex(@"\b(?:(?x264)|(?h264)|(?XvidHD)|(?Xvid)|(?divx))\b",