From da5feda71b6e64de03d89a096321e3f6e260e3fd Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 11 Feb 2021 17:00:11 -0800 Subject: [PATCH] Fixed: Parsing of release names with trailing colon in the title --- src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs | 3 +++ src/NzbDrone.Core/Parser/Parser.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs index c33009fd8..c38ef78c7 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -61,6 +61,9 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("World.Movie.Z.2.EXTENDED.2013.German.DL.1080p.BluRay.AVC-XANOR", "World Movie Z 2")] [TestCase("G.I.Movie.Movie.2013.THEATRiCAL.COMPLETE.BLURAY-GLiMMER", "G.I. Movie Movie")] [TestCase("www.Torrenting.org - Movie.2008.720p.X264-DIMENSION", "Movie")] + + //Dont think this will ever apply but adding it to keep the regex in line with upstream + [TestCase("Movie name: 2013.THEATRiCAL.COMPLETE.BLURAY-GLiMMER", "Movie name")] public void should_parse_movie_title(string postTitle, string title) { Parser.Parser.ParseMovieTitle(postTitle).MovieTitle.Should().Be(title); diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 9f3c45597..045ffa715 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -91,7 +91,7 @@ namespace NzbDrone.Core.Parser private static readonly Regex ReportImdbId = new Regex(@"(?tt\d{7,8})", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex ReportTmdbId = new Regex(@"tmdb(id)?-(?\d+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); - private static readonly RegexReplace SimpleTitleRegex = new RegexReplace(@"\s*(?:480[ip]|576[ip]|720[ip]|1080[ip]|2160[ip]|[xh][\W_]?26[45]|DD\W?5\W1|[<>?*:|]|848x480|1280x720|1920x1080|(8|10)b(it)?)", + private static readonly RegexReplace SimpleTitleRegex = new RegexReplace(@"\s*(?:480[ip]|576[ip]|720[ip]|1080[ip]|2160[ip]|[xh][\W_]?26[45]|DD\W?5\W1|[<>?*|]|848x480|1280x720|1920x1080|(8|10)b(it)?)", string.Empty, RegexOptions.IgnoreCase | RegexOptions.Compiled);