diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index dfd255661..196d8c605 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -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); diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index 9792d87fc..a62d81579 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Core.Parser private static readonly Regex RealRegex = new Regex(@"\b(?REAL)\b", RegexOptions.Compiled); - private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?480p|640x480|848x480)|(?576p)|(?720p|1280x720)|(?1080p|1920x1080|1440p|FHD|1080i)|(?2160p|4k[-_. ](?:UHD|HEVC|BD)|(?:UHD|HEVC|BD)[-_. ]4k))\b", + private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?360p)|(?480p|640x480|848x480)|(?576p)|(?720p|1280x720)|(?1080p|1920x1080|1440p|FHD|1080i)|(?2160p|4k[-_. ](?:UHD|HEVC|BD)|(?:UHD|HEVC|BD)[-_. ]4k))\b", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex CodecRegex = new Regex(@"\b(?:(?x264)|(?h264)|(?XvidHD)|(?Xvid)|(?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,