|
|
|
@ -10,34 +10,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class ParserFixture : CoreTest
|
|
|
|
|
{
|
|
|
|
|
/*Fucked-up hall of shame,
|
|
|
|
|
* WWE.Wrestlemania.27.PPV.HDTV.XviD-KYR
|
|
|
|
|
* Unreported.World.Chinas.Lost.Sons.WS.PDTV.XviD-FTP
|
|
|
|
|
* [TestCase("Big Time Rush 1x01 to 10 480i DD2 0 Sianto", "Big Time Rush", 1, new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, 10)]
|
|
|
|
|
* [TestCase("Desparate Housewives - S07E22 - 7x23 - And Lots of Security.. [HDTV-720p].mkv", "Desparate Housewives", 7, new[] { 22, 23 }, 2)]
|
|
|
|
|
* [TestCase("S07E22 - 7x23 - And Lots of Security.. [HDTV-720p].mkv", "", 7, new[] { 22, 23 }, 2)]
|
|
|
|
|
* (Game of Thrones s03 e - "Game of Thrones Season 3 Episode 10"
|
|
|
|
|
* The.Man.of.Steel.1994-05.33.hybrid.DreamGirl-Novus-HD
|
|
|
|
|
* Superman.-.The.Man.of.Steel.1994-06.34.hybrid.DreamGirl-Novus-HD
|
|
|
|
|
* Superman.-.The.Man.of.Steel.1994-05.33.hybrid.DreamGirl-Novus-HD
|
|
|
|
|
* Constantine S1-E1-WEB-DL-1080p-NZBgeek
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
[TestCase("Chuck - 4x05 - Title", "Chuck")]
|
|
|
|
|
[TestCase("Law & Order - 4x05 - Title", "laworder")]
|
|
|
|
|
[TestCase("Bad Format", "badformat")]
|
|
|
|
|
[TestCase("Mad Men - Season 1 [Bluray720p]", "madmen")]
|
|
|
|
|
[TestCase("Mad Men - Season 1 [Bluray1080p]", "madmen")]
|
|
|
|
|
[TestCase("The Daily Show With Jon Stewart -", "thedailyshowwithjonstewart")]
|
|
|
|
|
[TestCase("The Venture Bros. (2004)", "theventurebros2004")]
|
|
|
|
|
[TestCase("Castle (2011)", "castle2011")]
|
|
|
|
|
[TestCase("Adventure Time S02 720p HDTV x264 CRON", "adventuretime")]
|
|
|
|
|
[TestCase("Hawaii Five 0", "hawaiifive0")]
|
|
|
|
|
[TestCase("Match of the Day", "matchday")]
|
|
|
|
|
[TestCase("Match of the Day 2", "matchday2")]
|
|
|
|
|
[TestCase("[ www.Torrenting.com ] - Revenge.S03E14.720p.HDTV.X264-DIMENSION", "Revenge")]
|
|
|
|
|
[TestCase("Seed S02E09 HDTV x264-2HD [eztv]-[rarbg.com]", "Seed")]
|
|
|
|
|
[TestCase("Reno.911.S01.DVDRip.DD2.0.x264-DEEP", "Reno 911")]
|
|
|
|
|
public void should_parse_artist_name(string postTitle, string title)
|
|
|
|
|
{
|
|
|
|
|
var result = Parser.Parser.ParseArtistName(postTitle).CleanArtistName();
|
|
|
|
@ -58,14 +31,14 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
|
Parser.Parser.ParseAlbumTitle(postTitle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestCase("[scnzbefnet][509103] 2.Broke.Girls.S03E18.720p.HDTV.X264-DIMENSION", "2 Broke Girls")]
|
|
|
|
|
[TestCase("[scnzbefnet][509103] Jay-Z - 4:44 (Deluxe Edition) (2017) 320", "Jay-Z")]
|
|
|
|
|
public void should_remove_request_info_from_title(string postTitle, string title)
|
|
|
|
|
{
|
|
|
|
|
Parser.Parser.ParseAlbumTitle(postTitle).ArtistName.Should().Be(title);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestCase("Revolution.S01E02.Chained.Heat.mkv")]
|
|
|
|
|
[TestCase("Dexter - S01E01 - Title.avi")]
|
|
|
|
|
[TestCase("02 Unchained.flac")]
|
|
|
|
|
[TestCase("Fall Out Boy - 02 - Title.wav")]
|
|
|
|
|
public void should_parse_quality_from_extension(string title)
|
|
|
|
|
{
|
|
|
|
|
Parser.Parser.ParseAlbumTitle(title).Quality.Quality.Should().NotBe(Quality.Unknown);
|
|
|
|
@ -76,7 +49,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
|
[TestCase("ATCQ - The Love Movement 1998 2CD 192kbps RIP", "ATCQ", "The Love Movement")]
|
|
|
|
|
[TestCase("A Tribe Called Quest - The Love Movement 1998 2CD [192kbps] RIP", "A Tribe Called Quest", "The Love Movement")]
|
|
|
|
|
[TestCase("Maula - Jism 2 [2012] Mp3 - 192Kbps [Extended]- TK", "Maula", "Jism 2")]
|
|
|
|
|
[TestCase("VA - Complete Clubland - The Ultimate Ride Of Your Lfe [2014][MP3][192 kbps]", "VA", "")]
|
|
|
|
|
[TestCase("VA - Complete Clubland - The Ultimate Ride Of Your Lfe [2014][MP3][192 kbps]", "VA", "Complete Clubland - The Ultimate Ride Of Your Lfe")]
|
|
|
|
|
[TestCase("Complete Clubland - The Ultimate Ride Of Your Lfe [2014][MP3](192kbps)", "Complete Clubland", "The Ultimate Ride Of Your Lfe")]
|
|
|
|
|
[TestCase("The Ultimate Ride Of Your Lfe [192 KBPS][2014][MP3]", "", "The Ultimate Ride Of Your Lfe")]
|
|
|
|
|
[TestCase("Gary Clark Jr - Live North America 2016 (2017) MP3 192kbps", "Gary Clark Jr", "Live North America 2016")]
|
|
|
|
@ -86,7 +59,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
|
[TestCase("Ricardo Arjona - APNEA (Single 2014) (320 kbps)", "Ricardo Arjona", "APNEA")]
|
|
|
|
|
[TestCase("Kehlani - SweetSexySavage (Deluxe Edition) (2017) 320", "Kehlani", "SweetSexySavage")]
|
|
|
|
|
[TestCase("Anderson Paak - Malibu (320)(2016)", "Anderson Paak", "Malibu")]
|
|
|
|
|
[TestCase("Caetano Veloso Discografia Completa MP3 @256", "Caetano Veloso", "")]
|
|
|
|
|
[TestCase("Caetano Veloso Discografia Completa MP3 @256", "Caetano Veloso", "", true)]
|
|
|
|
|
[TestCase("Little Mix - Salute [Deluxe Edition] [2013] [M4A-256]-V3nom [GLT", "Little Mix", "Salute")]
|
|
|
|
|
[TestCase("Ricky Martin - A Quien Quiera Escuchar (2015) 256 kbps [GloDLS]", "Ricky Martin", "A Quien Quiera Escuchar")]
|
|
|
|
|
[TestCase("Jake Bugg - Jake Bugg (Album) [2012] {MP3 256 kbps}", "Jake Bugg", "Jake Bugg")]
|
|
|
|
@ -107,7 +80,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
|
[TestCase("The Rolling Stones - The Very Best Of '75-'94 (1995) {FLAC}", "The Rolling Stones", "The Very Best Of '75-'94")]
|
|
|
|
|
[TestCase("Migos-No_Label_II-CD-FLAC-2014-FORSAKEN", "Migos", "No Label II")]
|
|
|
|
|
[TestCase("ADELE 25 CD FLAC 2015 PERFECT", "Adele", "25")]
|
|
|
|
|
[TestCase("A.I. - Sex & Robots [2007/MP3/V0(VBR)]", "A.I.", "Sex & Robots")]
|
|
|
|
|
[TestCase("A.I. - Sex & Robots [2007/MP3/V0(VBR)]", "A I", "Sex & Robots")]
|
|
|
|
|
[TestCase("Jay-Z - 4:44 (Deluxe Edition) (2017) 320", "Jay-Z", "444")]
|
|
|
|
|
[TestCase("Roberta Flack 2006 - The Very Best of", "Roberta Flack", "The Very Best of")]
|
|
|
|
|
[TestCase("VA - NOW Thats What I Call Music 96 (2017) [Mp3~Kbps]", "VA", "NOW Thats What I Call Music 96")]
|
|
|
|
@ -118,12 +91,16 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
|
[TestCase("Dani_Sbert-Togheter-WEB-2017-FURY", "Dani Sbert", "Togheter")]
|
|
|
|
|
[TestCase("New.Edition-One.Love-CD-FLAC-2017-MrFlac", "New Edition", "One Love")]
|
|
|
|
|
[TestCase("David_Gray-The_Best_of_David_Gray-(Deluxe_Edition)-2CD-2016-MTD", "David Gray", "The Best of David Gray")]
|
|
|
|
|
public void should_parse_artist_name_and_album_title(string postTitle, string name, string title)
|
|
|
|
|
[TestCase("Shinedown-Us and Them-NMR-2005-NMR", "Shinedown", "Us and Them")]
|
|
|
|
|
[TestCase("Captain-Discography_1998_-_2001-CD-FLAC-2007-UTP", "Captain", "", true)]
|
|
|
|
|
[TestCase("Coolio - Gangsta's Paradise (1995) (FLAC Lossless)", "Coolio", "Gangsta's Paradise")]
|
|
|
|
|
public void should_parse_artist_name_and_album_title(string postTitle, string name, string title, bool discography = false)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var parseResult = Parser.Parser.ParseAlbumTitle(postTitle);
|
|
|
|
|
parseResult.ArtistName.Should().Be(name);
|
|
|
|
|
parseResult.AlbumTitle.Should().Be(title);
|
|
|
|
|
parseResult.Discography.Should().Be(discography);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|