Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

More cases for parsing regex

Joseph Milazzoc74b4c36c160
diff --git a/API.Tests/ParserTest.cs b/API.Tests/ParserTest.cs
index 76a457177..719194515 100644
--- a/API.Tests/ParserTest.cs
+++ b/API.Tests/ParserTest.cs
@@ -146,6 +146,8 @@ namespace API.Tests
[InlineData("VanDread-v01-c001[MD].zip", "1")]
[InlineData("Goblin Slayer Side Story - Year One 025.5", "25.5")]
[InlineData("Kedouin Makoto - Corpse Party Musume, Chapter 01", "1")]
+ [InlineData("To Love Ru v11 Uncensored (Ch.089-097+Omake)", "89-97")]
+ [InlineData("To Love Ru v18 Uncensored (Ch.153-162.5)", "153-162.5")]
public void ParseChaptersTest(string filename, string expected)
{
Assert.Equal(expected, ParseChapter(filename));
@@ -236,6 +238,7 @@ namespace API.Tests
[InlineData("Scott Pilgrim 01 - Scott Pilgrim's Precious Little Life (2004)", "Scott Pilgrim")]
[InlineData("Teen Titans v1 001 (1966-02) (digital) (OkC.O.M.P.U.T.O.-Novus)", "Teen Titans")]
[InlineData("Scott Pilgrim 02 - Scott Pilgrim vs. The World (2005)", "Scott Pilgrim")]
+ [InlineData("Wolverine - Origins 003 (2006) (digital) (Minutemen-PhD)", "Wolverine - Origins")]
public void ParseComicSeriesTest(string filename, string expected)
{
Assert.Equal(expected, ParseComicSeries(filename));
diff --git a/API/Data/kavita.db b/API/Data/kavita.db
new file mode 100644
index 000000000..c946be3fb
Binary files /dev/null and b/API/Data/kavita.db differ
diff --git a/API/Parser/Parser.cs b/API/Parser/Parser.cs
index c089a688e..d2c05353e 100644
--- a/API/Parser/Parser.cs
+++ b/API/Parser/Parser.cs
@@ -223,8 +223,9 @@ namespace API.Parser
private static readonly Regex[] MangaChapterRegex = new[]
{
+ // Historys Strongest Disciple Kenichi_v11_c90-98.zip, ...c90.5-100.5
new Regex(
- @"(c|ch)(\.? ?)(?<Chapter>\d+(?:.\d+|-\d+)?)",
+ @"(c|ch)(\.? ?)(?<Chapter>(\d+(\.\d)?)-?(\d+(\.\d)?)?)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
// [Suihei Kiki]_Kasumi_Otoko_no_Ko_[Taruby]_v1.1.zip
new Regex(