From 627b2a4289ecdd5558d37940624289708e01e10a Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 9 May 2024 17:25:49 -0700 Subject: [PATCH] New: Parse 480i Bluray/Remux as Bluray 480p Closes #6801 --- .../ParserTests/QualityParserFixture.cs | 5 +++ src/NzbDrone.Core/Parser/QualityParser.cs | 31 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index b9c434f18..a4f9ec8d3 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -109,6 +109,8 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("The.Series.S01E05.480p.BluRay.DD5.1.x264-HiSD", false)] [TestCase("The Series (BD)(640x480(RAW) (BATCH 1) (1-13)", false)] [TestCase("[Doki] Series - 02 (848x480 XviD BD MP3) [95360783]", false)] + [TestCase("Adventures.of.Sonic.the.Hedgehog.S01.BluRay.480i.DD.2.0.AVC.REMUX-FraMeSToR", false)] + [TestCase("Adventures.of.Sonic.the.Hedgehog.S01E01.Best.Hedgehog.480i.DD.2.0.AVC.REMUX-FraMeSToR", false)] public void should_parse_bluray480p_quality(string title, bool proper) { ParseAndVerifyQuality(title, Quality.Bluray480p, proper); @@ -309,6 +311,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("Sans.Series.De.Traces.FRENCH.720p.BluRay.x264-FHD", false)] [TestCase("Series.Black.1x01.Selezione.Naturale.ITA.720p.BDMux.x264-NovaRip", false)] [TestCase("Series.Hunter.S02.720p.Blu-ray.Remux.AVC.FLAC.2.0-SiCFoI", false)] + [TestCase("Adventures.of.Sonic.the.Hedgehog.S01E01.Best.Hedgehog.720p.DD.2.0.AVC.REMUX-FraMeSToR", false)] public void should_parse_bluray720p_quality(string title, bool proper) { ParseAndVerifyQuality(title, Quality.Bluray720p, proper); @@ -340,6 +343,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("Series.Title.S03E01.The.Calm.1080p.DTS-HD.MA.5.1.AVC.REMUX-FraMeSToR", false)] [TestCase("Series Title Season 2 (BDRemux 1080p HEVC FLAC) [Netaro]", false)] [TestCase("[Vodes] Series Title - Other Title (2020) [BDRemux 1080p HEVC Dual-Audio]", false)] + [TestCase("Adventures.of.Sonic.the.Hedgehog.S01E01.Best.Hedgehog.1080p.DD.2.0.AVC.REMUX-FraMeSToR", false)] public void should_parse_bluray1080p_remux_quality(string title, bool proper) { ParseAndVerifyQuality(title, Quality.Bluray1080pRemux, proper); @@ -360,6 +364,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("Series.Title.S01E08.The.Sonarr.BluRay.2160p.AVC.DTS-HD.MA.5.1.REMUX-FraMeSToR", false)] [TestCase("Series.Title.2x11.Nato.Per.The.Sonarr.Bluray.Remux.AVC.2160p.AC3.ITA", false)] [TestCase("[Dolby Vision] Sonarr.of.Series.S07.MULTi.UHD.BLURAY.REMUX.DV-NoTag", false)] + [TestCase("Adventures.of.Sonic.the.Hedgehog.S01E01.Best.Hedgehog.2160p.DD.2.0.AVC.REMUX-FraMeSToR", false)] public void should_parse_bluray2160p_remux_quality(string title, bool proper) { ParseAndVerifyQuality(title, Quality.Bluray2160pRemux, proper); diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index 7631887cd..d466054e6 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -46,7 +46,7 @@ namespace NzbDrone.Core.Parser private static readonly Regex RealRegex = new (@"\b(?REAL)\b", RegexOptions.Compiled); - private static readonly Regex ResolutionRegex = new (@"\b(?:(?360p)|(?480p|640x480|848x480)|(?540p)|(?576p)|(?720p|1280x720|960p)|(?1080p|1920x1080|1440p|FHD|1080i|4kto1080p)|(?2160p|3840x2160|4k[-_. ](?:UHD|HEVC|BD|H265)|(?:UHD|HEVC|BD|H265)[-_. ]4k))\b", + private static readonly Regex ResolutionRegex = new (@"\b(?:(?360p)|(?480p|480i|640x480|848x480)|(?540p)|(?576p)|(?720p|1280x720|960p)|(?1080p|1920x1080|1440p|FHD|1080i|4kto1080p)|(?2160p|3840x2160|4k[-_. ](?:UHD|HEVC|BD|H265)|(?:UHD|HEVC|BD|H265)[-_. ]4k))\b", RegexOptions.Compiled | RegexOptions.IgnoreCase); // Handle cases where no resolution is in the release name (assume if UHD then 4k) or resolution is non-standard @@ -311,6 +311,35 @@ namespace NzbDrone.Core.Parser } } + if (sourceMatch == null && remuxMatch && resolution != Resolution.Unknown) + { + result.SourceDetectionSource = QualityDetectionSource.Unknown; + + if (resolution == Resolution.R480P) + { + result.Quality = Quality.Bluray480p; + return result; + } + + if (resolution == Resolution.R720p) + { + result.Quality = Quality.Bluray720p; + return result; + } + + if (resolution == Resolution.R2160p) + { + result.Quality = Quality.Bluray2160pRemux; + return result; + } + + if (resolution == Resolution.R1080p) + { + result.Quality = Quality.Bluray1080pRemux; + return result; + } + } + // Anime Bluray matching if (AnimeBlurayRegex.Match(normalizedName).Success) {