diff --git a/API.Tests/Parser/ComicParserTests.cs b/API.Tests/Parser/ComicParserTests.cs index 9d91a5feb..6e33dd89c 100644 --- a/API.Tests/Parser/ComicParserTests.cs +++ b/API.Tests/Parser/ComicParserTests.cs @@ -20,6 +20,8 @@ namespace API.Tests.Parser [InlineData("Scott Pilgrim 02 - Scott Pilgrim vs. The World (2005)", "Scott Pilgrim")] [InlineData("Wolverine - Origins 003 (2006) (digital) (Minutemen-PhD)", "Wolverine - Origins")] [InlineData("Invincible Vol 01 Family matters (2005) (Digital).cbr", "Invincible")] + [InlineData("Amazing Man Comics chapter 25", "Amazing Man Comics")] + [InlineData("Amazing Man Comics issue #25", "Amazing Man Comics")] public void ParseComicSeriesTest(string filename, string expected) { Assert.Equal(expected, API.Parser.Parser.ParseComicSeries(filename)); @@ -40,6 +42,7 @@ namespace API.Tests.Parser [InlineData("Teen Titans v1 001 (1966-02) (digital) (OkC.O.M.P.U.T.O.-Novus)", "1")] [InlineData("Scott Pilgrim 02 - Scott Pilgrim vs. The World (2005)", "2")] [InlineData("Superman v1 024 (09-10 1943)", "1")] + [InlineData("Amazing Man Comics chapter 25", "0")] public void ParseComicVolumeTest(string filename, string expected) { Assert.Equal(expected, API.Parser.Parser.ParseComicVolume(filename)); @@ -61,6 +64,7 @@ namespace API.Tests.Parser [InlineData("Teen Titans v1 001 (1966-02) (digital) (OkC.O.M.P.U.T.O.-Novus)", "1")] [InlineData("Superman v1 024 (09-10 1943)", "24")] [InlineData("Invincible 070.5 - Invincible Returns 1 (2010) (digital) (Minutemen-InnerDemons).cbr", "70.5")] + [InlineData("Amazing Man Comics chapter 25", "25")] public void ParseComicChapterTest(string filename, string expected) { Assert.Equal(expected, API.Parser.Parser.ParseComicChapter(filename)); diff --git a/API/Parser/Parser.cs b/API/Parser/Parser.cs index e6ac20a1f..5bfe954e8 100644 --- a/API/Parser/Parser.cs +++ b/API/Parser/Parser.cs @@ -200,6 +200,14 @@ namespace API.Parser new Regex( @"^(?.*)(?: |_)v\d+", RegexOptions.IgnoreCase | RegexOptions.Compiled), + // Amazing Man Comics chapter 25 + new Regex( + @"^(?.*)(?: |_)c(hapter) \d+", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + // Amazing Man Comics issue #25 + new Regex( + @"^(?.*)(?: |_)i(ssue) #\d+", + RegexOptions.IgnoreCase | RegexOptions.Compiled), // 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( @"^(?.*)(?: \d+)", @@ -242,11 +250,11 @@ namespace API.Parser RegexOptions.IgnoreCase | RegexOptions.Compiled), // Scott Pilgrim 02 - Scott Pilgrim vs. The World (2005) new Regex( - @"^(?.*)(?: |_)(?\d+)", + @"^(?.*)(?\d+)", RegexOptions.IgnoreCase | RegexOptions.Compiled), // 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( - @"^(?.*)(?\d+))", + @"^(?.*)(?\d+))", RegexOptions.IgnoreCase | RegexOptions.Compiled), // Batman & Robin the Teen Wonder #0 new Regex( @@ -284,6 +292,14 @@ namespace API.Parser new Regex( @"^(?.*)(?: |_)(c? ?)(?(\d+(\.\d)?)-?(\d+(\.\d)?)?)(c? ?)-", RegexOptions.IgnoreCase | RegexOptions.Compiled), + // Amazing Man Comics chapter 25 + new Regex( + @"^(?!Vol)(?.*)( |_)c(hapter)( |_)(?\d*)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + // Amazing Man Comics issue #25 + new Regex( + @"^(?!Vol)(?.*)( |_)i(ssue)( |_) #(?\d*)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), }; private static readonly Regex[] ReleaseGroupRegex = new[]