Fixed: Improved parsing of iTunes named files

This commit is contained in:
Mark McDowall 2018-04-29 21:56:33 -07:00
parent 6c09b7dc28
commit b5ce3b2773
2 changed files with 5 additions and 0 deletions

View File

@ -130,6 +130,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Shortland.Street.S26E022.HDTV.x264-FiHTV", "Shortland Street", 26, 22)]
[TestCase("Super.Potatoes.S01.Ep06.1080p.BluRay.DTS.x264-MiR", "Super Potatoes", 1, 6)]
[TestCase("Room 104 - S01E07 The Missionaries [SDTV]", "Room 104", 1, 7)]
[TestCase("11-02 The Retraction Reaction (HD).m4v", "", 11, 2)]
//[TestCase("", "", 0, 0)]
public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber)
{

View File

@ -192,6 +192,10 @@ namespace NzbDrone.Core.Parser
new Regex(@"^(?:Season(?:_|-|\s|\.)(?<season>(?<!\d+)\d{1,2}(?!\d+)))(?:_|-|\s|\.)(?<episode>(?<!\d+)\d{1,2}(?!\d+))",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//iTunes 1-05 Title (Quality).ext
new Regex(@"^(?:(?<season>(?<!\d+)(?:\d{1,2})(?!\d+))(?:-(?<episode>\d{2,3}(?!\d+))))",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Anime - Title Absolute Episode Number (e66)
new Regex(@"^(?:\[(?<subgroup>.+?)\][-_. ]?)?(?<title>.+?)(?:(?:_|-|\s|\.)+(?:e|ep)(?<absoluteepisode>\d{2,3}))+.*?(?<hash>\[\w{8}\])?(?:$|\.)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),