From 19f724dcd987e8bce7661faa0825d9eccc1da8d0 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 13 Oct 2020 00:06:12 -0700 Subject: [PATCH] Fixed: Limit Raw HD detection by MPEG-2 to HDTV sources --- src/NzbDrone.Core/Parser/QualityParser.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index 1bc922c30..d9812349f 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -31,9 +31,11 @@ namespace NzbDrone.Core.Parser )(?:\b|$|[ .])", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); - private static readonly Regex RawHDRegex = new Regex(@"\b(?RawHD|1080i[-_. ]HDTV|Raw[-_. ]HD|MPEG[-_. ]?2)\b", + private static readonly Regex RawHDRegex = new Regex(@"\b(?RawHD|1080i[-_. ]HDTV|Raw[-_. ]HD)\b", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private static readonly Regex MPEG2Regex = new Regex(@"\b(?MPEG[-_. ]?2)\b"); + private static readonly Regex ProperRegex = new Regex(@"\b(?proper)\b", RegexOptions.Compiled | RegexOptions.IgnoreCase); @@ -210,6 +212,12 @@ namespace NzbDrone.Core.Parser if (sourceMatch.Groups["hdtv"].Success) { + if (MPEG2Regex.IsMatch(normalizedName)) + { + result.Quality = Quality.RAWHD; + return result; + } + if (resolution == Resolution.R2160p) { result.Quality = Quality.HDTV2160p; @@ -403,7 +411,6 @@ namespace NzbDrone.Core.Parser } } - if (codecRegex.Groups["x264"].Success) { result.Quality = Quality.SDTV;