mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
More cases for parsing regex
This commit is contained in:
parent
7e54d332f5
commit
c74b4c36c1
@ -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));
|
||||
|
BIN
API/Data/kavita.db
Normal file
BIN
API/Data/kavita.db
Normal file
Binary file not shown.
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user