Fixed: Parsing of some multi-episode titles

Closes #4612
pull/4659/head
Mark McDowall 3 years ago
parent 5c4687e0d9
commit 574f05e296

@ -71,6 +71,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Series Title - [02x01-x02] - Episode 1", "Series Title", 2, new [] { 1, 2})]
[TestCase("Series Title - [02x01-02] - Episode 1", "Series Title", 2, new [] { 1, 2})]
[TestCase("Series Title (2011) - S01E23-E24 - ...E i nuovi orizzonti [HDTV 360p] [ITA].mkv", "Series Title (2011)", 1, new [] { 23, 24 })]
[TestCase("The Series Title! - S01E01-02-03", "The Series Title!", 1, new [] { 1, 2, 3 })]
//[TestCase("", "", , new [] { })]
public void should_parse_multiple_episodes(string postTitle, string title, int season, int[] episodes)
{

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

Loading…
Cancel
Save