Fixed: Bluray 576p will be detected as DVD instead of Bluray 720p

pull/3113/head
Mark McDowall 11 years ago
parent a40b9a306e
commit 16c60ff92c

@ -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);

@ -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>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>x264)|(?<h264>h264)|(?<xvidhd>XvidHD)|(?<xvid>Xvid)|(?<divx>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

Loading…
Cancel
Save