diff --git a/src/NzbDrone.Core.Test/ParserTests/SeasonParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/SeasonParserFixture.cs index 563c70ed6..58a146ec3 100644 --- a/src/NzbDrone.Core.Test/ParserTests/SeasonParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/SeasonParserFixture.cs @@ -92,5 +92,12 @@ namespace NzbDrone.Core.Test.ParserTests result.IsPartialSeason.Should().BeFalse(); result.IsMultiSeason.Should().BeTrue(); } + + [Test] + public void should_not_parse_season_folders() + { + var result = Parser.Parser.ParseTitle("Season 3"); + result.Should().BeNull(); + } } } diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 21c414784..bcafa9a71 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -341,6 +341,11 @@ namespace NzbDrone.Core.Parser new Regex(@"^\d{6}_\d{2}$"), }; + private static readonly Regex[] SeasonFolderRegexes = new Regex[] + { + new Regex(@"^(Season[ ._-]*\d+|Specials)$", RegexOptions.Compiled) + }; + //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); @@ -917,6 +922,12 @@ namespace NzbDrone.Core.Parser return false; } + if (SeasonFolderRegexes.Any(v => v.IsMatch(titleWithoutExtension))) + { + Logger.Debug("Rejected Season Folder Release Title: " + title); + return false; + } + return true; }