Fixed: Parsing of 360p releases

Fixes #3519
pull/3430/head
Mark McDowall 5 years ago
parent 544108df37
commit e51f1b5e16

@ -63,6 +63,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("[CR] Sailor Moon - 004 [480p][48CE2D0F]", false)]
[TestCase("[Hatsuyuki] Naruto Shippuuden - 363 [848x480][ADE35E38]", false)]
[TestCase("Muppet.Babies.S03.TVRip.XviD-NOGRP", false)]
[TestCase("[HorribleSubs] ID INVADED - 03 [360p].mkv", false)]
public void should_parse_sdtv_quality(string title, bool proper)
{
ParseAndVerifyQuality(title, Quality.SDTV, proper);
@ -74,6 +75,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("the.shield.1x13.circles.ws.xvidvd-tns", false)]
[TestCase("the_x-files.9x18.sunshine_days.ac3.ws_dvdrip_xvid-fov.avi", false)]
[TestCase("[FroZen] Miyuki - 23 [DVD][7F6170E6]", false)]
[TestCase("[AniDL] Vandread - 26 -[360p][DVD][D - A][Exiled - Destiny]", false)]
public void should_parse_dvd_quality(string title, bool proper)
{
ParseAndVerifyQuality(title, Quality.DVD, proper);

@ -44,7 +44,7 @@ namespace NzbDrone.Core.Parser
private static readonly Regex RealRegex = new Regex(@"\b(?<real>REAL)\b",
RegexOptions.Compiled);
private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?<R480p>480p|640x480|848x480)|(?<R576p>576p)|(?<R720p>720p|1280x720)|(?<R1080p>1080p|1920x1080|1440p|FHD|1080i)|(?<R2160p>2160p|4k[-_. ](?:UHD|HEVC|BD)|(?:UHD|HEVC|BD)[-_. ]4k))\b",
private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?<R360p>360p)|(?<R480p>480p|640x480|848x480)|(?<R576p>576p)|(?<R720p>720p|1280x720)|(?<R1080p>1080p|1920x1080|1440p|FHD|1080i)|(?<R2160p>2160p|4k[-_. ](?:UHD|HEVC|BD)|(?:UHD|HEVC|BD)[-_. ]4k))\b",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex CodecRegex = new Regex(@"\b(?:(?<x264>x264)|(?<h264>h264)|(?<xvidhd>XvidHD)|(?<xvid>Xvid)|(?<divx>divx))\b",
@ -124,7 +124,7 @@ namespace NzbDrone.Core.Parser
return result;
}
if (resolution == Resolution.R480P || resolution == Resolution.R576p)
if (resolution == Resolution.R360P || resolution == Resolution.R480P || resolution == Resolution.R576p)
{
result.Quality = Quality.Bluray480p;
return result;
@ -280,7 +280,8 @@ namespace NzbDrone.Core.Parser
// Anime Bluray matching
if (AnimeBlurayRegex.Match(normalizedName).Success)
{
if (resolution == Resolution.R480P || resolution == Resolution.R576p || normalizedName.Contains("480p"))
if (resolution == Resolution.R360P || resolution == Resolution.R480P ||
resolution == Resolution.R576p || normalizedName.Contains("480p"))
{
result.Quality = Quality.DVD;
return result;
@ -327,7 +328,7 @@ namespace NzbDrone.Core.Parser
return result;
}
if (resolution == Resolution.R480P)
if (resolution == Resolution.R360P || resolution == Resolution.R480P)
{
result.Quality = Quality.SDTV;
return result;
@ -399,6 +400,7 @@ namespace NzbDrone.Core.Parser
var match = ResolutionRegex.Match(name);
if (!match.Success) return Resolution.Unknown;
if (match.Groups["R360p"].Success) return Resolution.R360P;
if (match.Groups["R480p"].Success) return Resolution.R480P;
if (match.Groups["R576p"].Success) return Resolution.R576p;
if (match.Groups["R720p"].Success) return Resolution.R720p;
@ -456,6 +458,7 @@ namespace NzbDrone.Core.Parser
public enum Resolution
{
R360P,
R480P,
R576p,
R720p,

Loading…
Cancel
Save