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

This commit is contained in:
Mark McDowall 2012-01-02 18:18:36 -08:00
parent ffde7c0987
commit e958a019ed
2 changed files with 9 additions and 2 deletions

View File

@ -390,5 +390,12 @@ namespace NzbDrone.Core.Test
ExceptionVerification.IgnoreWarns(); ExceptionVerification.IgnoreWarns();
ExceptionVerification.ExpectedErrors(1); 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);
}
} }
} }

View File

@ -44,11 +44,11 @@ namespace NzbDrone.Core
RegexOptions.IgnoreCase | RegexOptions.Compiled), RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Supports 1103/1113 naming //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), RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Supports 103/113 naming //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), RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Supports Season only releases //Supports Season only releases