Added: Parser case for Artist - Album - Year [Other]

This commit is contained in:
Qstick 2018-08-26 21:48:49 -04:00
parent 499af45566
commit c3d2769d3f
2 changed files with 7 additions and 0 deletions

View File

@ -167,6 +167,9 @@ namespace NzbDrone.Core.Test.ParserTests
//[TestCase("(R'n'B / Soul) Moyton - One of the Sta(2014) + Ocean(2014), MP3, 320 kbps", "Moyton", "")]
[TestCase("(Heavy Metal) Aria - Discography(46 CD) [1985 - 2015], FLAC(image + .cue), lossless", "Aria", "Discography", true)]
[TestCase("(Heavy Metal) [CD] Forces United - Discography(6 CDs), 2014-2016, FLAC(image + .cue), lossless", "Forces United", "Discography", true)]
[TestCase("Gorillaz - The now now - 2018 [FLAC]", "Gorillaz", "The now now")]
//Regex Works on below, but ParseAlbumMatchCollection cleans the "..." and converts it to spaces
[TestCase("Metallica - ...And Justice for All (1988) [FLAC Lossless]", "Metallica", "...And Justice for All")]
public void should_parse_artist_name_and_album_title(string postTitle, string name, string title, bool discography = false)
{

View File

@ -88,6 +88,10 @@ namespace NzbDrone.Core.Parser
new Regex(@"^(?:(?<artist>.+?)(?: - )+)(?<album>.+?)\W*(?:\(|\[)(?<releaseyear>\d{4})",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Artist - Album - Year [something]
new Regex(@"^(?:(?<artist>.+?)(?: - )+)(?<album>.+?)\W*(?: - )(?<releaseyear>\d{4})\W*(?:\(|\[)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
//Artist - Album [something] or Artist - Album (something)
new Regex(@"^(?:(?<artist>.+?)(?: - )+)(?<album>.+?)\W*(?:\(|\[)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),