From 0dbb3789eb67c5bf8a7db3088b34c474154c6c29 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 25 Sep 2011 18:00:21 -0700 Subject: [PATCH] Treat SUBPACK's as extra releases, so they will not be downloaded. --- NzbDrone.Core.Test/ParserTest.cs | 10 ++++++++++ NzbDrone.Core/Parser.cs | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 5445e5394..de6583347 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -363,5 +363,15 @@ namespace NzbDrone.Core.Test result.Should().BeNull(); } + + [TestCase("Lie.to.Me.S03.SUBPACK.DVDRip.XviD-REWARD")] + [TestCase("The.Middle.S02.SUBPACK.DVDRip.XviD-REWARD")] + [TestCase("CSI.S11.SUBPACK.DVDRip.XviD-REWARD")] + public void parse_season_subpack(string postTitle) + { + var result = Parser.ParseTitle(postTitle); + + result.Should().BeNull(); + } } } \ No newline at end of file diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index 4711e41c5..ab4e64ed4 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Core RegexOptions.IgnoreCase | RegexOptions.Compiled), //Supports Season only releases - new Regex(@"^(?.+?)\W(?:S|Season)\W?(?<season>\d{1,2}(?!\d+))\W?(?<extras>EXTRAS)?(?!\\)", + new Regex(@"^(?<title>.+?)\W(?:S|Season)\W?(?<season>\d{1,2}(?!\d+))\W?(?<extras>EXTRAS|SUBPACK)?(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled) }; @@ -135,7 +135,7 @@ namespace NzbDrone.Core else { - //Check to see if this is an "Extras" pack, if it is, return NULL + //Check to see if this is an "Extras" or "SUBPACK" release, if it is, return NULL //Todo: Set a "Extras" flag in EpisodeParseResult if we want to download them ever if (!String.IsNullOrEmpty(match[0].Groups["extras"].Value)) return null;