mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Fixed: Parsing for Artist-Album-Year
release
This commit is contained in:
parent
dc1eb63099
commit
5a57c0cf17
2 changed files with 9 additions and 6 deletions
|
@ -161,6 +161,9 @@ namespace NzbDrone.Core.Test.ParserTests
|
||||||
[TestCase("Minor Threat - Complete Discography [1989] [Anthology]", "Minor Threat", "Discography", true)]
|
[TestCase("Minor Threat - Complete Discography [1989] [Anthology]", "Minor Threat", "Discography", true)]
|
||||||
[TestCase("Captain-Discography_1998_-_2001-CD-FLAC-2007-UTP", "Captain", "Discography", true)]
|
[TestCase("Captain-Discography_1998_-_2001-CD-FLAC-2007-UTP", "Captain", "Discography", true)]
|
||||||
[TestCase("Coolio - Gangsta's Paradise (1995) (FLAC Lossless)", "Coolio", "Gangsta's Paradise")]
|
[TestCase("Coolio - Gangsta's Paradise (1995) (FLAC Lossless)", "Coolio", "Gangsta's Paradise")]
|
||||||
|
[TestCase("Brother Ali-2007-The Undisputed Truth-FTD", "Brother Ali", "The Undisputed Truth")]
|
||||||
|
[TestCase("Brother Ali-The Undisputed Truth-2007-FTD", "Brother Ali", "The Undisputed Truth")]
|
||||||
|
|
||||||
// ruTracker
|
// ruTracker
|
||||||
[TestCase("(Eclectic Progressive Rock) [CD] Peter Hammill - From The Trees - 2017, FLAC (tracks + .cue), lossless", "Peter Hammill","From The Trees")]
|
[TestCase("(Eclectic Progressive Rock) [CD] Peter Hammill - From The Trees - 2017, FLAC (tracks + .cue), lossless", "Peter Hammill","From The Trees")]
|
||||||
[TestCase("(Folk Rock / Pop) Aztec Two-Step - Naked - 2017, MP3, 320 kbps", "Aztec Two-Step", "Naked")]
|
[TestCase("(Folk Rock / Pop) Aztec Two-Step - Naked - 2017, MP3, 320 kbps", "Aztec Two-Step", "Naked")]
|
||||||
|
@ -172,6 +175,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
||||||
[TestCase("(Heavy Metal) Aria - Discography(46 CD) [1985 - 2015], FLAC(image + .cue), lossless", "Aria", "Discography", true)]
|
[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("(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")]
|
[TestCase("Gorillaz - The now now - 2018 [FLAC]", "Gorillaz", "The now now")]
|
||||||
|
|
||||||
//Regex Works on below, but ParseAlbumMatchCollection cleans the "..." and converts it to spaces
|
//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")]
|
[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)
|
public void should_parse_artist_name_and_album_title(string postTitle, string name, string title, bool discography = false)
|
||||||
|
|
|
@ -119,16 +119,15 @@ namespace NzbDrone.Core.Parser
|
||||||
new Regex(@"^(?:(?<artist>.+?)(?:-)+)(?<album>.+?)(?:-.+?)(?<releaseyear>\d{4})",
|
new Regex(@"^(?:(?<artist>.+?)(?:-)+)(?<album>.+?)(?:-.+?)(?<releaseyear>\d{4})",
|
||||||
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
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
|
//Artist-Album Year
|
||||||
//Hyphen no space between artist and album
|
//Hyphen no space between artist and album
|
||||||
new Regex(@"^(?:(?<artist>.+?)(?:-)+)(?<album>.+?)\b(?<releaseyear>\d{4})",
|
new Regex(@"^(?:(?<artist>.+?)(?:-)+)(?:(?<album>.+?)(?:-)+)(?<releaseyear>\d{4})",
|
||||||
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
||||||
|
|
||||||
|
//Artist - Year - Album
|
||||||
|
// Hypen with no or more spaces between artist/album/year
|
||||||
|
new Regex(@"^(?:(?<artist>.+?)(?:-))(?<releaseyear>\d{4})(?:-)(?<album>[^-]+)",
|
||||||
|
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue