From 16c60ff92c2e61df04b1f35d17da0932b6eb5e94 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 24 May 2014 23:21:53 -0700 Subject: [PATCH] Fixed: Bluray 576p will be detected as DVD instead of Bluray 720p --- .../ParserTests/QualityParserFixture.cs | 1 + src/NzbDrone.Core/Parser/QualityParser.cs | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index 2a6ae3317..7dd478b6d 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -56,6 +56,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("The.Girls.Next.Door.S03E06.DVD.Rip.XviD-WiDE", false)] [TestCase("the.shield.1x13.circles.ws.xvidvd-tns", false)] [TestCase("the_x-files.9x18.sunshine_days.ac3.ws_dvdrip_xvid-fov.avi", false)] + [TestCase("Hannibal.S01E05.576p.BluRay.DD5.1.x264-HiSD", false)] public void should_parse_dvd_quality(string title, bool proper) { ParseAndVerifyQuality(title, Quality.DVD, proper); diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index 331133767..55e317227 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -5,7 +5,6 @@ using NLog; using NzbDrone.Common; using NzbDrone.Core.MediaFiles; using NzbDrone.Core.Qualities; -using NzbDrone.Core.Tv; namespace NzbDrone.Core.Parser { @@ -32,7 +31,7 @@ namespace NzbDrone.Core.Parser private static readonly Regex ProperRegex = new Regex(@"\b(?proper|repack)\b", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?<_480p>480p)|(?<_720p>720p)|(?<_1080p>1080p))\b", + private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?<_480p>480p)|(?<_576p>576p)|(?<_720p>720p)|(?<_1080p>1080p))\b", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex CodecRegex = new Regex(@"\b(?:(?x264)|(?h264)|(?XvidHD)|(?Xvid)|(?divx))\b", @@ -72,6 +71,12 @@ namespace NzbDrone.Core.Parser return result; } + if (resolution == Resolution._576p) + { + result.Quality = Quality.DVD; + return result; + } + result.Quality = Quality.Bluray720p; return result; } @@ -209,6 +214,7 @@ namespace NzbDrone.Core.Parser if (!match.Success) return Resolution.Unknown; if (match.Groups["_480p"].Success) return Resolution._480p; + if (match.Groups["_576p"].Success) return Resolution._576p; if (match.Groups["_720p"].Success) return Resolution._720p; if (match.Groups["_1080p"].Success) return Resolution._1080p; @@ -219,6 +225,7 @@ namespace NzbDrone.Core.Parser public enum Resolution { _480p, + _576p, _720p, _1080p, Unknown