Fixed: 3 digit season/episode numbers followed by an underscore

pull/6/head
Mark McDowall 10 years ago
parent 89d0293f6e
commit a21b539298

@ -85,7 +85,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("2009x09 [SDTV].avi", "", 2009, 9)]
[TestCase("S2009E09 [SDTV].avi", "", 2009, 9)]
[TestCase("Shark Week S2009E09 [SDTV].avi", "Shark Week", 2009, 9)]
// [TestCase("", "", 0, 0)]
[TestCase("St_Elsewhere_209_Aids_And_Comfort", "St Elsewhere", 2, 9)]
//[TestCase("", "", 0, 0)]
public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber)
{
var result = Parser.Parser.ParseTitle(postTitle);

@ -59,7 +59,7 @@ namespace NzbDrone.Core.Parser
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Supports 103/113 naming
new Regex(@"^(?<title>.+?)?(?:\W?(?<season>(?<!\d+)[1-9])(?<episode>[1-9][0-9]|[0][1-9])(?!\w|\d+))+",
new Regex(@"^(?<title>.+?)?(?:(?:\W?|_)(?<season>(?<!\d+)[1-9])(?<episode>[1-9][0-9]|[0][1-9])(?![a-z]|\d+))+",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Mini-Series, treated as season 1, episodes are labelled as Part01, Part 01, Part.1
@ -79,7 +79,7 @@ namespace NzbDrone.Core.Parser
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Supports 1103/1113 naming
new Regex(@"^(?<title>.+?)?(?:\W?(?<season>(?<!\d+|\(|\[|e|x)\d{2})(?<episode>(?<!e|x)\d{2}(?!p|i|\d+|\)|\]|\W\d+)))+(\W+|_|$)(?!\\)",
new Regex(@"^(?<title>.+?)?(?:(?:\W|_)?(?<season>(?<!\d+|\(|\[|e|x)\d{2})(?<episode>(?<!e|x)\d{2}(?!p|i|\d+|\)|\]|\W\d+)))+(\W+|_|$)(?!\\)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//4-digit episode number

Loading…
Cancel
Save