Restrict 4k parsing to avoid false positives

This commit is contained in:
Mark McDowall 2018-11-03 11:30:41 -07:00
parent da73221cef
commit bb3ca998fc
2 changed files with 3 additions and 1 deletions

View File

@ -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 [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) public void should_parse_hdtv2160p_quality(string title, bool proper)
{ {
ParseAndVerifyQuality(title, Quality.HDTV2160p, 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.4K.UHD.Bluray", false)]
[TestCase("House.of.Cards.US.s05e13.UHD.4K.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) public void should_parse_bluray2160p_quality(string title, bool proper)
{ {
ParseAndVerifyQuality(title, Quality.Bluray2160p, proper); ParseAndVerifyQuality(title, Quality.Bluray2160p, proper);

View File

@ -40,7 +40,7 @@ namespace NzbDrone.Core.Parser
private static readonly Regex RealRegex = new Regex(@"\b(?<real>REAL)\b", private static readonly Regex RealRegex = new Regex(@"\b(?<real>REAL)\b",
RegexOptions.Compiled); RegexOptions.Compiled);
private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?<R480p>480p|640x480|848x480)|(?<R576p>576p)|(?<R720p>720p|1280x720)|(?<R1080p>1080p|1920x1080|1440p)|(?<R2160p>2160p|4k[-_. ]UHD|UHD[-_. ]4k|[-_. ]4k))\b", private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?<R480p>480p|640x480|848x480)|(?<R576p>576p)|(?<R720p>720p|1280x720)|(?<R1080p>1080p|1920x1080|1440p)|(?<R2160p>2160p|4k[-_. ](?:UHD|HEVC|BD)|(?:UHD|HEVC|BD)[-_. ]4k))\b",
RegexOptions.Compiled | RegexOptions.IgnoreCase); RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex CodecRegex = new Regex(@"\b(?:(?<x264>x264)|(?<h264>h264)|(?<xvidhd>XvidHD)|(?<xvid>Xvid)|(?<divx>divx))\b", private static readonly Regex CodecRegex = new Regex(@"\b(?:(?<x264>x264)|(?<h264>h264)|(?<xvidhd>XvidHD)|(?<xvid>Xvid)|(?<divx>divx))\b",