mirror of https://github.com/lidarr/Lidarr
Added: Parser case for Artist - Album - Year [Other]
This commit is contained in:
parent
499af45566
commit
c3d2769d3f
|
@ -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("(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) 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")]
|
||||||
|
//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)
|
public void should_parse_artist_name_and_album_title(string postTitle, string name, string title, bool discography = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,10 @@ namespace NzbDrone.Core.Parser
|
||||||
new Regex(@"^(?:(?<artist>.+?)(?: - )+)(?<album>.+?)\W*(?:\(|\[)(?<releaseyear>\d{4})",
|
new Regex(@"^(?:(?<artist>.+?)(?: - )+)(?<album>.+?)\W*(?:\(|\[)(?<releaseyear>\d{4})",
|
||||||
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
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)
|
//Artist - Album [something] or Artist - Album (something)
|
||||||
new Regex(@"^(?:(?<artist>.+?)(?: - )+)(?<album>.+?)\W*(?:\(|\[)",
|
new Regex(@"^(?:(?<artist>.+?)(?: - )+)(?<album>.+?)\W*(?:\(|\[)",
|
||||||
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
||||||
|
|
Loading…
Reference in New Issue