From f215ba9bac4d65619bad3d31a848bcf255d39f3f Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Thu, 7 Feb 2019 12:52:18 +0100 Subject: [PATCH] Fixed: Additional reverse title parser patterns. fixes #2943 --- .../ParserTests/HashedReleaseFixture.cs | 14 ++++++++++++++ src/NzbDrone.Core/Parser/Parser.cs | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs b/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs index 6eec4058f..663581d75 100644 --- a/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs @@ -94,6 +94,20 @@ public class HashedReleaseFixture : CoreTest "Sons of Anarchy", Quality.HDTV720p, null + }, + new object[] + { + @"50E50S.denorD.mkv".AsOsAgnostic(), + "Droned", + Quality.HDTV720p, + null + }, + new object[] + { + @"C:\Test\XxQVHK4GJMP3n2dLpmhW\XxQVHK4GJMP3n2dLpmhW\50E50S.denorD.mkv".AsOsAgnostic(), + "Droned", + Quality.HDTV720p, + null } }; diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 58df4cc78..9f1dbb88a 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -299,7 +299,7 @@ public static class Parser }; //Regex to detect whether the title was reversed. - private static readonly Regex ReversedTitleRegex = new Regex(@"[-._ ](p027|p0801|\d{2,3}E\d{2}S)[-._ ]", RegexOptions.Compiled); + private static readonly Regex ReversedTitleRegex = new Regex(@"(?:^|[-._ ])(p027|p0801|\d{2,3}E\d{2}S)[-._ ]", RegexOptions.Compiled); private static readonly Regex NormalizeRegex = new Regex(@"((?:\b|_)(?