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.

Fixed some parser unit tests around negative lookaheads

Joseph Milazzob66c6b57149c
diff --git a/API.Tests/ParserTest.cs b/API.Tests/ParserTest.cs
index 0190e6dc7..fb985a24a 100644
--- a/API.Tests/ParserTest.cs
+++ b/API.Tests/ParserTest.cs
@@ -178,9 +178,9 @@ namespace API.Tests
[Theory]
[InlineData("test.cbz", true)]
- [InlineData("test.cbr", false)]
+ [InlineData("test.cbr", true)]
[InlineData("test.zip", true)]
- [InlineData("test.rar", false)]
+ [InlineData("test.rar", true)]
[InlineData("test.rar.!qb", false)]
[InlineData("[shf-ma-khs-aqs]negi_pa_vol15007.jpg", false)]
public void IsArchiveTest(string input, bool expected)
diff --git a/API/Parser/Parser.cs b/API/Parser/Parser.cs
index ec7cc8223..0a3466dbf 100644
--- a/API/Parser/Parser.cs
+++ b/API/Parser/Parser.cs
@@ -130,7 +130,7 @@ namespace API.Parser
// Hinowa ga CRUSH! 018 (2019) (Digital) (LuCaZ).cbz, Hinowa ga CRUSH! 018.5 (2019) (Digital) (LuCaZ).cbz
new Regex(
- @"^(?!Vol)(?<Series>.*) (?<Chapter>\d+(?:.\d+|-\d+)?)(?: \(\d{4}\))?",
+ @"^(?!Vol)(?<Series>.*) (?<!vol\. )(?<Chapter>\d+(?:.\d+|-\d+)?)(?: \(\d{4}\))?",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
// Tower Of God S01 014 (CBT) (digital).cbz
new Regex(