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.

Add support for mangapy syntax to parser (#538)

Christoffer Green623105ecd4cb
diff --git a/.gitignore b/.gitignore
index 756e09822..9f28eec22 100644
--- a/.gitignore
+++ b/.gitignore
@@ -499,3 +499,4 @@ _temp/
_output/
API/stats/
UI/Web/dist/
+/API.Tests/Extensions/Test Data/modified on run.txt
diff --git a/API.Tests/Parser/MangaParserTests.cs b/API.Tests/Parser/MangaParserTests.cs
index fdd8cafa3..d27f22dd9 100644
--- a/API.Tests/Parser/MangaParserTests.cs
+++ b/API.Tests/Parser/MangaParserTests.cs
@@ -26,6 +26,7 @@ namespace API.Tests.Parser
[InlineData("Akame ga KILL! ZERO v01 (2016) (Digital) (LuCaZ).cbz", "1")]
[InlineData("v001", "1")]
[InlineData("Vol 1", "1")]
+ [InlineData("vol_356-1", "356")] // Mangapy syntax
[InlineData("No Volume", "0")]
[InlineData("U12 (Under 12) Vol. 0001 Ch. 0001 - Reiwa Scans (gb)", "1")]
[InlineData("[Suihei Kiki]_Kasumi_Otoko_no_Ko_[Taruby]_v1.1.zip", "1")]
diff --git a/API/Parser/Parser.cs b/API/Parser/Parser.cs
index 6814c9bf8..b7b4ee8eb 100644
--- a/API/Parser/Parser.cs
+++ b/API/Parser/Parser.cs
@@ -83,6 +83,11 @@ namespace API.Parser
@"(?<Series>.*)(\b|_|)(S(?<Volume>\d+))",
RegexOptions.IgnoreCase | RegexOptions.Compiled,
RegexTimeout),
+ // vol_001-1.cbz for MangaPy default naming convention
+ new Regex(
+ @"(vol_)(?<Volume>\d+)",
+ RegexOptions.IgnoreCase | RegexOptions.Compiled,
+ RegexTimeout),
};
private static readonly Regex[] MangaSeriesRegex = new[]