Updated parser to skip longer than expected numbers from being parsed.

pull/7/merge
Mark McDowall 13 years ago
parent ffde7c0987
commit e958a019ed

@ -390,5 +390,12 @@ namespace NzbDrone.Core.Test
ExceptionVerification.IgnoreWarns();
ExceptionVerification.ExpectedErrors(1);
}
[TestCase(@"C:\BuildAgent\work\b5a20f8391187721\NzbDrone.Core.Test\bin\Release\WEEDS.avi")]
public void parseTitle_should_log_warning_when_unable_to_parse(string title)
{
Parser.ParseTitle(title);
ExceptionVerification.ExpectedWarns(1);
}
}
}

@ -44,11 +44,11 @@ namespace NzbDrone.Core
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Supports 1103/1113 naming
new Regex(@"^(?<title>.+?)?(?:\W?(?<season>\d{2})(?<episode>\d{2}(?!p|i)))+\W?(?!\\)",
new Regex(@"^(?<title>.+?)?(?:\W?(?<season>(?<!\d+)\d{2})(?<episode>\d{2}(?!p|i|\d+)))+\W?(?!\\)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Supports 103/113 naming
new Regex(@"^(?<title>.+?)?(?:\W?(?<season>\d{1})(?<episode>\d{2}(?!p|i|\d+)))+\W?(?!\\)",
new Regex(@"^(?<title>.+?)?(?:\W?(?<season>(?<!\d+)\d{1})(?<episode>\d{2}(?!p|i|\d+)))+\W?(?!\\)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Supports Season only releases

Loading…
Cancel
Save