diff --git a/API.Tests/Parser/ComicParserTests.cs b/API.Tests/Parser/ComicParserTests.cs index ccfd672bc..043c0e027 100644 --- a/API.Tests/Parser/ComicParserTests.cs +++ b/API.Tests/Parser/ComicParserTests.cs @@ -58,6 +58,11 @@ namespace API.Tests.Parser [InlineData("2000 AD 0366 [1984-04-28] (flopbie)", "2000 AD")] [InlineData("Daredevil - v6 - 10 - (2019)", "Daredevil")] [InlineData("Batman - The Man Who Laughs #1 (2005)", "Batman - The Man Who Laughs")] + [InlineData("Demon 012 (Sep 1973) c2c", "Demon")] + [InlineData("Dragon Age - Until We Sleep 01 (of 03)", "Dragon Age - Until We Sleep")] + [InlineData("Green Lantern v2 017 - The Spy-Eye that doomed Green Lantern v2", "Green Lantern")] + [InlineData("Green Lantern - Circle of Fire Special - Adam Strange (2000)", "Green Lantern - Circle of Fire - Adam Strange")] + [InlineData("Identity Crisis Extra - Rags Morales Sketches (2005)", "Identity Crisis - Rags Morales Sketches")] public void ParseComicSeriesTest(string filename, string expected) { Assert.Equal(expected, API.Parser.Parser.ParseComicSeries(filename)); diff --git a/API/Parser/Parser.cs b/API/Parser/Parser.cs index efc15f36b..02dc6894c 100644 --- a/API/Parser/Parser.cs +++ b/API/Parser/Parser.cs @@ -258,19 +258,19 @@ namespace API.Parser MatchOptions, RegexTimeout), // Teen Titans v1 001 (1966-02) (digital) (OkC.O.M.P.U.T.O.-Novus) new Regex( - @"^(?.*)(?: |_)v\d+", + @"^(?.+?)(?: |_)v\d+", MatchOptions, RegexTimeout), // Amazing Man Comics chapter 25 new Regex( - @"^(?.*)(?: |_)c(hapter) \d+", + @"^(?.+?)(?: |_)c(hapter) \d+", MatchOptions, RegexTimeout), // Amazing Man Comics issue #25 new Regex( - @"^(?.*)(?: |_)i(ssue) #\d+", + @"^(?.+?)(?: |_)i(ssue) #\d+", MatchOptions, RegexTimeout), // Batman Wayne Family Adventures - Ep. 001 - Moving In new Regex( - @"^(?.+?)(\s|_|-)?(?:Ep\.?)(\s|_|-)+\d+", + @"^(?.+?)(\s|_|-)(?:Ep\.?)(\s|_|-)+\d+", MatchOptions, RegexTimeout), // Batgirl Vol.2000 #57 (December, 2004) new Regex( @@ -286,7 +286,7 @@ namespace API.Parser MatchOptions, RegexTimeout), // Scott Pilgrim 02 - Scott Pilgrim vs. The World (2005) new Regex( - @"^(?.*)(?: |_)(?\d+)", + @"^(?.+?)(?: |_)(?\d+)", MatchOptions, RegexTimeout), // The First Asterix Frieze (WebP by Doc MaKS) new Regex( @@ -887,7 +887,7 @@ namespace API.Parser { if (match.Success) { - title = title.Replace(match.Value, "").Trim(); + title = title.Replace(match.Value, string.Empty).Trim(); } } } @@ -904,7 +904,7 @@ namespace API.Parser { if (match.Success) { - title = title.Replace(match.Value, "").Trim(); + title = title.Replace(match.Value, string.Empty).Trim(); } } } @@ -950,7 +950,7 @@ namespace API.Parser { if (match.Success) { - title = title.Replace(match.Value, ""); + title = title.Replace(match.Value, string.Empty); } } }