diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index 0880a5f71..1d1e2f840 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -64,6 +64,8 @@ public class QualityParserFixture : CoreTest [TestCase("[Hatsuyuki] The Series - 363 [848x480][ADE35E38]", false)] [TestCase("The.Series.S03.TVRip.XviD-NOGRP", false)] [TestCase("[HorribleSubs] The Series - 03 [360p].mkv", false)] + [TestCase("[SubsPlease] Series Title (540p) [AB649D32].mkv", false)] + [TestCase("[Erai-raws] Series Title [540p][Multiple Subtitle].mkv", false)] public void should_parse_sdtv_quality(string title, bool proper) { ParseAndVerifyQuality(title, Quality.SDTV, proper); diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index 779107a64..3d0e755b6 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -46,7 +46,8 @@ public class QualityParser private static readonly Regex RealRegex = new Regex(@"\b(?REAL)\b", RegexOptions.Compiled); - private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?360p)|(?480p|640x480|848x480)|(?576p)|(?720p|1280x720)|(?1080p|1920x1080|1440p|FHD|1080i|4kto1080p)|(?2160p|4k[-_. ](?:UHD|HEVC|BD)|(?:UHD|HEVC|BD)[-_. ]4k))\b", + private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?360p)|(?480p|640x480|848x480)|(?540p)|(?576p)|(?720p|1280x720)|(?1080p|1920x1080|1440p|FHD|1080i|4kto1080p)|(?2160p|4k[-_. ](?:UHD|HEVC|BD)|(?:UHD|HEVC|BD)[-_. ]4k))\b", + RegexOptions.Compiled | RegexOptions.IgnoreCase); //Handle cases where no resolution is in the release name; assume if UHD then 4k @@ -142,7 +143,8 @@ public static QualityModel ParseQualityName(string name) return result; } - if (resolution == Resolution.R360P || resolution == Resolution.R480P || resolution == Resolution.R576p) + if (resolution == Resolution.R360P || resolution == Resolution.R480P || + resolution == Resolution.R540p || resolution == Resolution.R576p) { result.Quality = Quality.Bluray480p; return result; @@ -307,7 +309,8 @@ public static QualityModel ParseQualityName(string name) result.SourceDetectionSource = QualityDetectionSource.Name; if (resolution == Resolution.R360P || resolution == Resolution.R480P || - resolution == Resolution.R576p || normalizedName.ContainsIgnoreCase("480p")) + resolution == Resolution.R540p || resolution == Resolution.R576p || + normalizedName.ContainsIgnoreCase("480p")) { result.ResolutionDetectionSource = QualityDetectionSource.Name; result.Quality = Quality.DVD; @@ -347,7 +350,8 @@ public static QualityModel ParseQualityName(string name) result.SourceDetectionSource = QualityDetectionSource.Name; if (resolution == Resolution.R360P || resolution == Resolution.R480P || - resolution == Resolution.R576p || normalizedName.ContainsIgnoreCase("480p")) + resolution == Resolution.R540p || resolution == Resolution.R576p || + normalizedName.ContainsIgnoreCase("480p")) { result.ResolutionDetectionSource = QualityDetectionSource.Name; result.Quality = Quality.WEBDL480p; @@ -435,7 +439,8 @@ public static QualityModel ParseQualityName(string name) return result; } - if (resolution == Resolution.R360P || resolution == Resolution.R480P) + if (resolution == Resolution.R360P || resolution == Resolution.R480P || + resolution == Resolution.R540p || resolution == Resolution.R576p) { result.ResolutionDetectionSource = QualityDetectionSource.Name; @@ -557,6 +562,7 @@ private static Resolution ParseResolution(string name) if (!match.Success & !matchimplied.Success) return Resolution.Unknown; if (match.Groups["R360p"].Success) return Resolution.R360P; if (match.Groups["R480p"].Success) return Resolution.R480P; + if (match.Groups["R540p"].Success) return Resolution.R540p; if (match.Groups["R576p"].Success) return Resolution.R576p; if (match.Groups["R720p"].Success) return Resolution.R720p; if (match.Groups["R1080p"].Success) return Resolution.R1080p; @@ -621,6 +627,7 @@ public enum Resolution { R360P, R480P, + R540p, R576p, R720p, R1080p,