Pushing up changes
Fixed issue with cleanTitleTest. Tried some patterns for "Cyberpunk 2077" but reverted
This commit is contained in:
parent
d07372b911
commit
0be13399f4
3 changed files with 20 additions and 12 deletions
|
|
@ -48,10 +48,12 @@ namespace API.Tests.Parser
|
|||
[InlineData("Chew v1 - Taster´s Choise (2012) (Digital) (1920) (Kingpin-Empire)", "Chew")]
|
||||
[InlineData("Chew Script Book (2011) (digital-Empire) SP04", "Chew Script Book")]
|
||||
[InlineData("Batman - Detective Comics - Rebirth Deluxe Edition Book 02 (2018) (digital) (Son of Ultron-Empire)", "Batman - Detective Comics - Rebirth Deluxe Edition Book")]
|
||||
[InlineData("Cyberpunk 2077 - Your Voice 01", "Cyberpunk 2077")]
|
||||
[InlineData("Cyberpunk 2077 - Your Voice 01", "Cyberpunk 2077 - Your Voice")]
|
||||
[InlineData("Cyberpunk 2077 #01", "Cyberpunk 2077")]
|
||||
[InlineData("Cyberpunk 2077 - Trauma Team 04.cbz", "Cyberpunk 2077 - Trauma Team")]
|
||||
[InlineData("Batgirl Vol.2000 #57 (December, 2004)", "Batgirl")]
|
||||
[InlineData("Batgirl V2000 #57", "Batgirl")]
|
||||
[InlineData("Fables 021 (2004) (Digital) (Nahga-Empire).cbr", "Fables")]
|
||||
public void ParseComicSeriesTest(string filename, string expected)
|
||||
{
|
||||
Assert.Equal(expected, API.Parser.Parser.ParseComicSeries(filename));
|
||||
|
|
@ -84,6 +86,8 @@ namespace API.Tests.Parser
|
|||
[InlineData("Chew Script Book (2011) (digital-Empire) SP04", "0")]
|
||||
[InlineData("Batgirl Vol.2000 #57 (December, 2004)", "2000")]
|
||||
[InlineData("Batgirl V2000 #57", "2000")]
|
||||
[InlineData("Fables 021 (2004) (Digital) (Nahga-Empire).cbr", "0")]
|
||||
[InlineData("Cyberpunk 2077 - Trauma Team 04.cbz", "0")]
|
||||
public void ParseComicVolumeTest(string filename, string expected)
|
||||
{
|
||||
Assert.Equal(expected, API.Parser.Parser.ParseComicVolume(filename));
|
||||
|
|
@ -120,6 +124,8 @@ namespace API.Tests.Parser
|
|||
[InlineData("Chew Script Book (2011) (digital-Empire) SP04", "0")]
|
||||
[InlineData("Batgirl Vol.2000 #57 (December, 2004)", "57")]
|
||||
[InlineData("Batgirl V2000 #57", "57")]
|
||||
[InlineData("Fables 021 (2004) (Digital) (Nahga-Empire).cbr", "21")]
|
||||
[InlineData("Cyberpunk 2077 - Trauma Team 04.cbz", "4")]
|
||||
public void ParseComicChapterTest(string filename, string expected)
|
||||
{
|
||||
Assert.Equal(expected, API.Parser.Parser.ParseComicChapter(filename));
|
||||
|
|
|
|||
|
|
@ -36,15 +36,15 @@ namespace API.Tests.Parser
|
|||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Hello_I_am_here", "Hello I am here")]
|
||||
[InlineData("Hello_I_am_here ", "Hello I am here")]
|
||||
[InlineData("[ReleaseGroup] The Title", "The Title")]
|
||||
[InlineData("[ReleaseGroup]_The_Title", "The Title")]
|
||||
[InlineData("[Suihei Kiki]_Kasumi_Otoko_no_Ko_[Taruby]_v1.1", "Kasumi Otoko no Ko v1.1")]
|
||||
[InlineData("Batman - Detective Comics - Rebirth Deluxe Edition Book 04 (2019) (digital) (Son of Ultron-Empire)", "Batman - Detective Comics - Rebirth Deluxe Edition")]
|
||||
public void CleanTitleTest(string input, string expected)
|
||||
[InlineData("Hello_I_am_here", false, "Hello I am here")]
|
||||
[InlineData("Hello_I_am_here ", false, "Hello I am here")]
|
||||
[InlineData("[ReleaseGroup] The Title", false, "The Title")]
|
||||
[InlineData("[ReleaseGroup]_The_Title", false, "The Title")]
|
||||
[InlineData("[Suihei Kiki]_Kasumi_Otoko_no_Ko_[Taruby]_v1.1", false, "Kasumi Otoko no Ko v1.1")]
|
||||
[InlineData("Batman - Detective Comics - Rebirth Deluxe Edition Book 04 (2019) (digital) (Son of Ultron-Empire)", true, "Batman - Detective Comics - Rebirth Deluxe Edition")]
|
||||
public void CleanTitleTest(string input, bool isComic, string expected)
|
||||
{
|
||||
Assert.Equal(expected, CleanTitle(input));
|
||||
Assert.Equal(expected, CleanTitle(input, isComic));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -317,11 +317,13 @@ namespace API.Parser
|
|||
@"^(?<Series>.+?)Vol\.?\s?#?(?:\d+)",
|
||||
MatchOptions,
|
||||
RegexTimeout),
|
||||
|
||||
// Batman & Catwoman - Trail of the Gun 01, Batman & Grendel (1996) 01 - Devil's Bones, Teen Titans v1 001 (1966-02) (digital) (OkC.O.M.P.U.T.O.-Novus)
|
||||
new Regex(
|
||||
@"^(?<Series>.+?)(?: \d+)",
|
||||
MatchOptions,
|
||||
RegexTimeout),
|
||||
|
||||
// Batman & Robin the Teen Wonder #0
|
||||
new Regex(
|
||||
@"^(?<Series>.*)(?: |_)#\d+",
|
||||
|
|
@ -618,7 +620,7 @@ namespace API.Parser
|
|||
var edition = ParseEdition(fileName);
|
||||
if (!string.IsNullOrEmpty(edition))
|
||||
{
|
||||
ret.Series = CleanTitle(ret.Series.Replace(edition, ""), type == LibraryType.Comic);
|
||||
ret.Series = CleanTitle(ret.Series.Replace(edition, ""), type is LibraryType.Comic);
|
||||
ret.Edition = edition;
|
||||
}
|
||||
|
||||
|
|
@ -643,7 +645,7 @@ namespace API.Parser
|
|||
|
||||
if (string.IsNullOrEmpty(ret.Series))
|
||||
{
|
||||
ret.Series = CleanTitle(fileName, type == LibraryType.Comic);
|
||||
ret.Series = CleanTitle(fileName, type is LibraryType.Comic);
|
||||
}
|
||||
|
||||
// Pdfs may have .pdf in the series name, remove that
|
||||
|
|
@ -691,7 +693,7 @@ namespace API.Parser
|
|||
|
||||
if ((string.IsNullOrEmpty(series) && i == fallbackFolders.Count - 1))
|
||||
{
|
||||
ret.Series = CleanTitle(folder, type == LibraryType.Comic);
|
||||
ret.Series = CleanTitle(folder, type is LibraryType.Comic);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue