mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 14:25:17 -04:00
New Scanner + People Pages (#3286)
Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
This commit is contained in:
@@ -714,8 +714,9 @@ public static class Parser
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
public static bool HasSpecialMarker(string filePath)
|
||||
public static bool HasSpecialMarker(string? filePath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filePath)) return false;
|
||||
return SpecialMarkerRegex.IsMatch(filePath);
|
||||
}
|
||||
|
||||
@@ -728,30 +729,19 @@ public static class Parser
|
||||
|
||||
public static bool IsSpecial(string? filePath, LibraryType type)
|
||||
{
|
||||
return type switch
|
||||
{
|
||||
LibraryType.Manga => IsMangaSpecial(filePath),
|
||||
LibraryType.Comic => IsComicSpecial(filePath),
|
||||
LibraryType.Book => IsMangaSpecial(filePath),
|
||||
LibraryType.Image => IsMangaSpecial(filePath),
|
||||
LibraryType.LightNovel => IsMangaSpecial(filePath),
|
||||
LibraryType.ComicVine => IsComicSpecial(filePath),
|
||||
_ => false
|
||||
};
|
||||
return HasSpecialMarker(filePath);
|
||||
}
|
||||
|
||||
private static bool IsMangaSpecial(string? filePath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filePath)) return false;
|
||||
filePath = ReplaceUnderscores(filePath);
|
||||
return MangaSpecialRegex.IsMatch(filePath);
|
||||
return HasSpecialMarker(filePath);
|
||||
}
|
||||
|
||||
private static bool IsComicSpecial(string? filePath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filePath)) return false;
|
||||
filePath = ReplaceUnderscores(filePath);
|
||||
return ComicSpecialRegex.IsMatch(filePath);
|
||||
return HasSpecialMarker(filePath);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user