Add support for mangapy syntax to parser (#538)

Added support for MangaPy's default naming convention to parser: vol_001-1.cbz
This commit is contained in:
Christoffer Green 2021-08-31 17:57:43 +02:00 committed by GitHub
parent 21c204d26f
commit 623105ecd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

1
.gitignore vendored
View File

@ -499,3 +499,4 @@ _temp/
_output/ _output/
API/stats/ API/stats/
UI/Web/dist/ UI/Web/dist/
/API.Tests/Extensions/Test Data/modified on run.txt

View File

@ -26,6 +26,7 @@ namespace API.Tests.Parser
[InlineData("Akame ga KILL! ZERO v01 (2016) (Digital) (LuCaZ).cbz", "1")] [InlineData("Akame ga KILL! ZERO v01 (2016) (Digital) (LuCaZ).cbz", "1")]
[InlineData("v001", "1")] [InlineData("v001", "1")]
[InlineData("Vol 1", "1")] [InlineData("Vol 1", "1")]
[InlineData("vol_356-1", "356")] // Mangapy syntax
[InlineData("No Volume", "0")] [InlineData("No Volume", "0")]
[InlineData("U12 (Under 12) Vol. 0001 Ch. 0001 - Reiwa Scans (gb)", "1")] [InlineData("U12 (Under 12) Vol. 0001 Ch. 0001 - Reiwa Scans (gb)", "1")]
[InlineData("[Suihei Kiki]_Kasumi_Otoko_no_Ko_[Taruby]_v1.1.zip", "1")] [InlineData("[Suihei Kiki]_Kasumi_Otoko_no_Ko_[Taruby]_v1.1.zip", "1")]

View File

@ -83,6 +83,11 @@ namespace API.Parser
@"(?<Series>.*)(\b|_|)(S(?<Volume>\d+))", @"(?<Series>.*)(\b|_|)(S(?<Volume>\d+))",
RegexOptions.IgnoreCase | RegexOptions.Compiled, RegexOptions.IgnoreCase | RegexOptions.Compiled,
RegexTimeout), 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[] private static readonly Regex[] MangaSeriesRegex = new[]