mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-05-21 15:16:33 -04:00
v0.8.4.1 - Hotfix (#3419)
Co-authored-by: Weblate (bot) <hosted@weblate.org> Co-authored-by: Adam Beneš <toohka@protonmail.com> Co-authored-by: Dark77 <Dark77@pobox.sk> Co-authored-by: Frozehunter <frozehunter@me.com> Co-authored-by: Havokdan <havokdan@yahoo.com.br> Co-authored-by: Yoan Jacquemin <yoanjacquemin@gmail.com> Co-authored-by: aleixcox <18121624@qq.com> Co-authored-by: mag37 <robin.ivehult@gmail.com>
This commit is contained in:
@@ -10,7 +10,7 @@ using API.Extensions;
|
||||
namespace API.Services.Tasks.Scanner.Parser;
|
||||
#nullable enable
|
||||
|
||||
public static class Parser
|
||||
public static partial class Parser
|
||||
{
|
||||
// NOTE: If you change this, don't forget to change in the UI (see Series Detail)
|
||||
public const string DefaultChapter = "-100000"; // -2147483648
|
||||
@@ -1054,7 +1054,7 @@ public static class Parser
|
||||
}
|
||||
|
||||
// Check if there is a range or not
|
||||
if (Regex.IsMatch(range, @"\d-{1}\d"))
|
||||
if (NumberRangeRegex().IsMatch(range))
|
||||
{
|
||||
|
||||
var tokens = range.Replace("_", string.Empty).Split("-", StringSplitOptions.RemoveEmptyEntries);
|
||||
@@ -1081,7 +1081,7 @@ public static class Parser
|
||||
}
|
||||
|
||||
// Check if there is a range or not
|
||||
if (Regex.IsMatch(range, @"\d-{1}\d"))
|
||||
if (NumberRangeRegex().IsMatch(range))
|
||||
{
|
||||
|
||||
var tokens = range.Replace("_", string.Empty).Split("-", StringSplitOptions.RemoveEmptyEntries);
|
||||
@@ -1244,10 +1244,15 @@ public static class Parser
|
||||
{
|
||||
if (string.IsNullOrEmpty(filename)) return filename;
|
||||
|
||||
if (Regex.IsMatch(filename, SupportedExtensions))
|
||||
if (SupportedExtensionsRegex().IsMatch(filename))
|
||||
{
|
||||
return Regex.Replace(filename, SupportedExtensions, string.Empty);
|
||||
return SupportedExtensionsRegex().Replace(filename, string.Empty);
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
[GeneratedRegex(SupportedExtensions)]
|
||||
private static partial Regex SupportedExtensionsRegex();
|
||||
[GeneratedRegex(@"\d-{1}\d")]
|
||||
private static partial Regex NumberRangeRegex();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user