From b51ce06e0404b999dff86a8a3bae7fc1bba2aac6 Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Sat, 2 Jan 2021 19:04:56 -0600 Subject: [PATCH] Fixed: Correctly Map 2160p releases that are BRRips as 2160p Closes #5639 --- .../ParserTests/QualityParserFixture.cs | 12 ++++++++++-- src/NzbDrone.Core/Parser/QualityParser.cs | 5 ++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index 5e844708df..8d1b4c9422 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -254,8 +254,16 @@ public void should_parse_bluray1080p_quality(string title, bool proper) ParseAndVerifyQuality(title, Source.BLURAY, proper, Resolution.R1080p); } - [TestCase("Rise.Of.The.Planet.Of.The.Apes.2011.2160p.UHD.BluRay.DD5.1.HDR.x265-CtrlHD.mkv", false)] - [TestCase("X-Men.Days.of.Future.Past.2014.2160p.UHD.BluRay.X265-IAMABLE.mkv", false)] + [TestCase("Revolution.S01E02.Chained.Heat.[Bluray2160p].mkv", false)] + [TestCase("[FFF] Namiuchigiwa no Muromi-san - 10 [BD][2160p-FLAC][0C4091AF]", false)] + [TestCase("[coldhell] Pupa v2 [BD2160p][5A45EABE].mkv", false)] + [TestCase("[Kaylith] Isshuukan Friends Specials - 01 [BD 2160p FLAC][429FD8C7].mkv", false)] + [TestCase("[Zurako] Log Horizon - 01 - The Apocalypse (BD 2160p AAC) [7AE12174].mkv", false)] + [TestCase("WEEDS.S03E01-06.DUAL.2160p.Blu-ray.AC3.-HELLYWOOD.avi", false)] + [TestCase("[Coalgirls]_Durarara!!_01_(3840x2160_Blu-ray_FLAC)_[8370CB8F].mkv", false)] + [TestCase("John.Carpenter.Live.Retrospective.2016.2018.2160p.MBluRay.x264-CRUELTY.mkv", false)] + [TestCase("Heart.Live.In.Atlantic.City.2019.2160p.MBLURAY.x264-MBLURAYFANS.mkv", false)] + [TestCase("Opeth.Garden.Of.The.Titans.Live.At.Red.Rocks.Amphitheatre.2017.2160p.MBluRay.x264-TREBLE.mkv", false)] public void should_parse_bluray2160p_quality(string title, bool proper) { ParseAndVerifyQuality(title, Source.BLURAY, proper, Resolution.R2160p); diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index 02dcb02ccf..87a34245d4 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -56,7 +56,7 @@ 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)|(?576p)|(?720p|1280x720)|(?1080p|1920x1080|1440p|FHD|1080i|4kto1080p)|(?2160p|3840x2160|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 @@ -339,6 +339,9 @@ public static QualityModel ParseQualityName(string name) case Resolution.R1080p: result.Quality = Quality.Bluray1080p; return result; + case Resolution.R2160p: + result.Quality = Quality.Bluray2160p; + return result; case Resolution.R576p: result.Quality = Quality.Bluray576p; return result;