From cba48507695a3624e8c23a18d3d22460d638e459 Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 1 May 2023 22:59:08 -0500 Subject: [PATCH] New: Handle multi title release names split by slash Closes #7917 Co-Authored-By: andrey4korop <24610708+andrey4korop@users.noreply.github.com> --- src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs | 7 +++++++ src/NzbDrone.Core/Parser/Parser.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs index 78933e8e7..8cb8501cc 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -193,6 +193,13 @@ namespace NzbDrone.Core.Test.ParserTests "Return Earth to Normal 'em High", "World 2" })] + [TestCase("Енола Голмс / Enola Holmes (2020) UHD WEB-DL 2160p 4K HDR H.265 Ukr/Eng | Sub Ukr/Eng", + new string[] + { + "Енола Голмс / Enola Holmes", + "Енола Голмс", + "Enola Holmes" + })] public void should_parse_movie_alternative_titles(string postTitle, string[] parsedTitles) { var movieInfo = Parser.Parser.ParseMovieTitle(postTitle, true); diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 7895b98e7..3d6d48944 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -100,7 +100,7 @@ namespace NzbDrone.Core.Parser private static readonly Regex ReversedTitleRegex = new Regex(@"(?:^|[-._ ])(p027|p0801)[-._ ]", RegexOptions.Compiled); // Regex to split movie titles that contain `AKA`. - private static readonly Regex AlternativeTitleRegex = new Regex(@"[ ]+AKA[ ]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); + private static readonly Regex AlternativeTitleRegex = new Regex(@"[ ]+(?:AKA|\/)[ ]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); // Regex to unbracket alternative titles. private static readonly Regex BracketedAlternativeTitleRegex = new Regex(@"(.*) \([ ]*AKA[ ]+(.*)\)", RegexOptions.IgnoreCase | RegexOptions.Compiled);