Fixed: Parsing of poor standard file names using dashes for separators

This commit is contained in:
Mark McDowall 2019-11-03 09:26:39 -08:00
parent dd314e1741
commit 70bb4d71e6
2 changed files with 2 additions and 1 deletions

View File

@ -139,6 +139,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Series.Title.S01.Ep01.English.AC3.DL.1080p.BluRay-Sonarr", "Series Title", 1, 1)]
[TestCase("Series.Title.S01.E01.English.AC3.DL.1080p.BluRay-Sonarr", "Series Title", 1, 1)]
[TestCase("Series.Title.S01EP01.English.AC3.DL.1080p.BluRay-Sonarr", "Series Title", 1, 1)]
[TestCase("tvs-amgo-dd51-dl-7p-azhd-x264-103", "tvs-amgo-dd51-dl-7p-azhd", 1, 3)]
//[TestCase("", "", 0, 0)]
public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber)
{

View File

@ -213,7 +213,7 @@ namespace NzbDrone.Core.Parser
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Supports 103/113 naming
new Regex(@"^(?<title>.+?)?(?:(?:[_.](?<![()\[!]))+(?<season>(?<!\d+)[1-9])(?<episode>[1-9][0-9]|[0][1-9])(?![a-z]|\d+))+(?:[_.]|$)",
new Regex(@"^(?<title>.+?)?(?:(?:[_.-](?<![()\[!]))+(?<season>(?<!\d+)[1-9])(?<episode>[1-9][0-9]|[0][1-9])(?![a-z]|\d+))+(?:[_.]|$)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//4 digit episode number