Implemented parsing case for Artist - Year - Album (#264) (#274)

* Implemented parsing case for Artist - Year - Album

* Enhanced test case to ensure year and artist also parse correctly.
Closes #264
This commit is contained in:
Joseph Milazzo
2018-04-04 18:02:06 -05:00
committed by Qstick
parent 226f884233
commit 798e85e4db
2 changed files with 18 additions and 0 deletions
+7
View File
@@ -115,10 +115,17 @@ namespace NzbDrone.Core.Parser
new Regex(@"^(?:(?<artist>.+?)(?:-)+)(?<album>.+?)(?:-.+?)(?<releaseyear>\d{4})",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Artist - Year - Album
// Hypen with no or more spaces between artist/album/year (must be before Artist-Album Year as that catches this case)
new Regex(@"^(?:(?<artist>.+?)\s*(?:-)+)\s*(?<releaseyear>\d{4})\s*(?:-+)\s*(?<album>.+)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Artist-Album Year
//Hyphen no space between artist and album
new Regex(@"^(?:(?<artist>.+?)(?:-)+)(?<album>.+?)\W*(?<releaseyear>\d{4})",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
};
private static readonly Regex[] RejectHashedReleasesRegex = new Regex[]