From 3a250e95b9171c62d5b297df10780fe97e672b53 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Fri, 16 Jan 2015 22:48:22 +0100 Subject: [PATCH] Fixed: No longer reports SxxExx as releasegroup if original title uses - separator. --- .../ParserTests/ReleaseGroupParserFixture.cs | 1 + src/NzbDrone.Core/Parser/Parser.cs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs index 3ea9e28b5..fb37f34c5 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ReleaseGroupParserFixture.cs @@ -25,6 +25,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("Simpsons 10x11 - Wild Barts Cant Be Broken [rl].avi", null)] [TestCase("[ www.Torrenting.com ] - Revenge.S03E14.720p.HDTV.X264-DIMENSION", "DIMENSION")] [TestCase("Seed S02E09 HDTV x264-2HD [eztv]-[rarbg.com]", "2HD")] + [TestCase("7s-atlantis-s02e01-720p.mkv", null)] //[TestCase("", "")] public void should_parse_release_group(string title, string expected) { diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index d6cc620d9..9cd1fc08f 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -165,13 +165,13 @@ namespace NzbDrone.Core.Parser private static readonly Regex SixDigitAirDateRegex = new Regex(@"(?<=[_.-])(?(?[1-9]\d{1})(?[0-1][0-9])(?[0-3][0-9]))(?=[_.-])", RegexOptions.IgnoreCase | RegexOptions.Compiled); - private static readonly Regex CleanReleaseGroupRegex = new Regex(@"^(\[\s.+?\s\])|-(RP|1|NZBGeek|sample)$", + private static readonly Regex CleanReleaseGroupRegex = new Regex(@"^(.*?[-._ ](S\d+E\d+)[-._ ])|-(RP|1|NZBGeek|sample)$", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex ReleaseGroupRegex = new Regex(@"-(?[a-z0-9]+)\b(?(?(?!\s).+?(?\bita\b|italian)|(?german\b|videomann)|(?flemish)|(?greek)|(?(?:\W|_)(?:FR|VOSTFR)(?:\W|_))|(?\brus\b)|(?nl\W?subs?)", @@ -362,7 +362,7 @@ namespace NzbDrone.Core.Parser { title = title.Trim(); title = RemoveFileExtension(title); - title = CleanReleaseGroupRegex.Replace(title, ""); + title = WebsitePrefixRegex.Replace(title, ""); var animeMatch = AnimeReleaseGroupRegex.Match(title); @@ -371,6 +371,8 @@ namespace NzbDrone.Core.Parser return animeMatch.Groups["subgroup"].Value; } + title = CleanReleaseGroupRegex.Replace(title, ""); + var matches = ReleaseGroupRegex.Matches(title); if (matches.Count != 0)