1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Releases with only extras will be skipped, with tests.

This commit is contained in:
Mark McDowall 2011-09-19 17:13:19 -07:00
parent 4604bbd821
commit 339f191ab8
2 changed files with 16 additions and 1 deletions

View File

@ -352,5 +352,15 @@ public void parse_size(string sizeString, long expectedSize)
result.Should().Be(expectedSize);
}
[TestCase("Acropolis Now S05 EXTRAS DVDRip XviD RUNNER")]
[TestCase("Punky Brewster S01 EXTRAS DVDRip XviD RUNNER")]
[TestCase("Instant Star S03 EXTRAS DVDRip XviD OSiTV")]
public void parse_season_extras(string postTitle)
{
var result = Parser.ParseTitle(postTitle);
result.Should().BeNull();
}
}
}

View File

@ -44,7 +44,7 @@ public static class Parser
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Supports Season only releases
new Regex(@"^(?<title>.+?)\W(?:S|Season)\W?(?<season>\d{1,2}(?!\d+))+\W?(?!\\)",
new Regex(@"^(?<title>.+?)\W(?:S|Season)\W?(?<season>\d{1,2}(?!\d+))\W(?<extras>EXTRAS)?(?!\\)",
RegexOptions.IgnoreCase | RegexOptions.Compiled)
};
@ -135,6 +135,11 @@ internal static EpisodeParseResult ParseTitle(string title)
else
{
//Check to see if this is an "Extras" pack, 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;
parsedEpisode.FullSeason = true;
}
}