mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Bugfix/parser (#214)
* Fixed #211 * Fixed #213. Somehow a + 1 got removed
This commit is contained in:
parent
c8adaee3eb
commit
beca4a4de5
@ -197,6 +197,7 @@ namespace API.Tests.Parser
|
|||||||
[InlineData("Kiss x Sis - Ch.00 - Let's Start from 0.cbz", "0")]
|
[InlineData("Kiss x Sis - Ch.00 - Let's Start from 0.cbz", "0")]
|
||||||
[InlineData("[Hidoi]_Amaenaideyo_MS_vol01_chp02.rar", "2")]
|
[InlineData("[Hidoi]_Amaenaideyo_MS_vol01_chp02.rar", "2")]
|
||||||
[InlineData("Okusama wa Shougakusei c003 (v01) [bokuwaNEET]", "3")]
|
[InlineData("Okusama wa Shougakusei c003 (v01) [bokuwaNEET]", "3")]
|
||||||
|
[InlineData("Tomogui Kyoushitsu - Chapter 006 Game 005 - Fingernails On Right Hand (Part 002).cbz", "6")]
|
||||||
public void ParseChaptersTest(string filename, string expected)
|
public void ParseChaptersTest(string filename, string expected)
|
||||||
{
|
{
|
||||||
Assert.Equal(expected, API.Parser.Parser.ParseChapter(filename));
|
Assert.Equal(expected, API.Parser.Parser.ParseChapter(filename));
|
||||||
|
@ -279,7 +279,7 @@ namespace API.Controllers
|
|||||||
if (chapterId > 0) return Ok(chapterId);
|
if (chapterId > 0) return Ok(chapterId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (volume.Number == currentVolume.Number)
|
if (volume.Number == currentVolume.Number + 1)
|
||||||
{
|
{
|
||||||
return Ok(volume.Chapters.FirstOrDefault()?.Id);
|
return Ok(volume.Chapters.FirstOrDefault()?.Id);
|
||||||
}
|
}
|
||||||
|
@ -302,7 +302,10 @@ namespace API.Parser
|
|||||||
new Regex(
|
new Regex(
|
||||||
@"^(?<Series>.*)(?: |_)#(?<Chapter>\d+)",
|
@"^(?<Series>.*)(?: |_)#(?<Chapter>\d+)",
|
||||||
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
||||||
|
// Green Worldz - Chapter 027
|
||||||
|
new Regex(
|
||||||
|
@"^(?!Vol)(?<Series>.*)\s?(?<!vol\. )\sChapter\s(?<Chapter>\d+(?:.\d+|-\d+)?)",
|
||||||
|
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
||||||
// Hinowa ga CRUSH! 018 (2019) (Digital) (LuCaZ).cbz, Hinowa ga CRUSH! 018.5 (2019) (Digital) (LuCaZ).cbz
|
// Hinowa ga CRUSH! 018 (2019) (Digital) (LuCaZ).cbz, Hinowa ga CRUSH! 018.5 (2019) (Digital) (LuCaZ).cbz
|
||||||
new Regex(
|
new Regex(
|
||||||
@"^(?!Vol)(?<Series>.*) (?<!vol\. )(?<Chapter>\d+(?:.\d+|-\d+)?)(?: \(\d{4}\))?(\b|_|-)",
|
@"^(?!Vol)(?<Series>.*) (?<!vol\. )(?<Chapter>\d+(?:.\d+|-\d+)?)(?: \(\d{4}\))?(\b|_|-)",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user