Skip to content

Commit ffa6bef

Browse files
committed
Fixed up a regression for a unique filename pattern (c79x1) which was getting caught in the scene name regex. (Fixes #4898)
1 parent 9210f1e commit ffa6bef

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Kavita.Services.Tests/Parsing/MangaParsingTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ public void ParseSeriesTest(string filename, string expected)
520520
// "31" is part of the series title ("The Long Summer of August 31"), not a chapter number.
521521
[InlineData("The Long Summer of August 31 Vol. 1.cbz", Parser.DefaultChapter)]
522522
[InlineData("BTOOOM! v03 (2013) (Digital) (c1fi7) (ED).cbz", Parser.DefaultChapter)]
523+
[InlineData("Series - c079x1 (2025) - Creator's Note.cbz", "79")]
523524
public void ParseChaptersTest(string filename, string expected)
524525
{
525526
Assert.Equal(expected, Parser.ParseChapter(filename, LibraryType.Manga));

Kavita.Services/Scanner/Parser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ public static partial class Parser
631631
// Trailing (?(Range)|(?![a-zA-Z])) keeps this from matching inside ripper/scanlator tags like "(c1fi7)"
632632
// (a bare short number glued to more letters) while still allowing ranges like c001-006x1.
633633
new Regex(
634-
@"(\b|_)(c|ch)(\.?\s?)(?<Chapter>(\d+(\.\d)?)(?<Range>-c?\d+(\.\d)?)?)(?(Range)|(?![a-zA-Z]))",
634+
@"(\b|_)(c|ch)(\.?\s?)(?<Chapter>(?>\d+(\.\d)?)(?<Range>-c?\d+(\.\d)?)?)(?(Range)|(?:x\d+)?(?![a-zA-Z]))",
635635
MatchOptions, RegexTimeout),
636636
// [Suihei Kiki]_Kasumi_Otoko_no_Ko_[Taruby]_v1.1.zip
637637
new Regex(

0 commit comments

Comments
 (0)