Fixed: Regression in parser incorrectly parsing S2015Exx.2015-01-01 notation.

fixes #1080
pull/6/head
Taloth Saldono 9 years ago
parent de379b2e47
commit f38d5de946

@ -116,6 +116,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Castle (2009) - [06x16] - Room 147.mp4", "Castle (2009)", 6, 16)] [TestCase("Castle (2009) - [06x16] - Room 147.mp4", "Castle (2009)", 6, 16)]
[TestCase("grp-zoos01e11-1080p", "grp-zoo", 1, 11)] [TestCase("grp-zoos01e11-1080p", "grp-zoo", 1, 11)]
[TestCase("grp-zoo-s01e11-1080p", "grp-zoo", 1, 11)] [TestCase("grp-zoo-s01e11-1080p", "grp-zoo", 1, 11)]
[TestCase("Jeopardy!.S2016E14.2016-01-20.avi", "Jeopardy!", 2016, 14)]
//[TestCase("", "", 0, 0)] //[TestCase("", "", 0, 0)]
public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber) public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber)
{ {

@ -67,7 +67,7 @@ namespace NzbDrone.Core.Parser
RegexOptions.IgnoreCase | RegexOptions.Compiled), RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Multi-episode Repeated (S01E05 - S01E06, 1x05 - 1x06, etc) //Multi-episode Repeated (S01E05 - S01E06, 1x05 - 1x06, etc)
new Regex(@"^(?<title>.+?)(?:(?:[-_\W](?<![()\[!]))+S?(?<season>(?<!\d+)(?:\d{1,2}|\d{4})(?!\d+))(?:(?:[-_. ex]){1,2}(?<episode>\d{1,3}(?!\d+)))+){2,}", new Regex(@"^(?<title>.+?)(?:(?:[-_\W](?<![()\[!]))+S?(?<season>(?<!\d+)(?:\d{1,2}|\d{4})(?!\d+))(?:(?:[ex]|[-_. ]e){1,2}(?<episode>\d{1,3}(?!\d+)))+){2,}",
RegexOptions.IgnoreCase | RegexOptions.Compiled), RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Episodes with a title, Single episodes (S01E05, 1x05, etc) & Multi-episode (S01E05E06, S01E05-06, S01E05 E06, etc) ** //Episodes with a title, Single episodes (S01E05, 1x05, etc) & Multi-episode (S01E05E06, S01E05-06, S01E05 E06, etc) **

Loading…
Cancel
Save