mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
parent
f64e93e29e
commit
8dda9220e6
1
.github/workflows/sonar-scan.yml
vendored
1
.github/workflows/sonar-scan.yml
vendored
@ -136,6 +136,7 @@ jobs:
|
|||||||
id: parse-body
|
id: parse-body
|
||||||
run: |
|
run: |
|
||||||
body='${{ steps.findPr.outputs.body }}'
|
body='${{ steps.findPr.outputs.body }}'
|
||||||
|
body=${body//\'/}
|
||||||
body="${body//'%'/'%25'}"
|
body="${body//'%'/'%25'}"
|
||||||
body="${body//$'\n'/'%0A'}"
|
body="${body//$'\n'/'%0A'}"
|
||||||
body="${body//$'\r'/'%0D'}"
|
body="${body//$'\r'/'%0D'}"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using API.Entities.Enums;
|
using API.Entities.Enums;
|
||||||
using API.Parser;
|
using API.Parser;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
@ -407,6 +407,10 @@ namespace API.Tests.Parser
|
|||||||
FullFilePath = filepath, IsSpecial = false
|
FullFilePath = filepath, IsSpecial = false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// If an image is cover exclusively, ignore it
|
||||||
|
filepath = @"E:\Manga\Seraph of the End\cover.png";
|
||||||
|
expected.Add(filepath, null);
|
||||||
|
|
||||||
|
|
||||||
foreach (var file in expected.Keys)
|
foreach (var file in expected.Keys)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
@ -552,6 +552,8 @@ namespace API.Parser
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsImage(filePath) && IsCoverImage(fileName)) return null;
|
||||||
|
|
||||||
if (IsImage(filePath))
|
if (IsImage(filePath))
|
||||||
{
|
{
|
||||||
// Reset Chapters, Volumes, and Series as images are not good to parse information out of. Better to use folders.
|
// Reset Chapters, Volumes, and Series as images are not good to parse information out of. Better to use folders.
|
||||||
@ -1027,6 +1029,7 @@ namespace API.Parser
|
|||||||
return Regex.Replace(name.ToLower(), "[^a-zA-Z0-9]", string.Empty);
|
return Regex.Replace(name.ToLower(), "[^a-zA-Z0-9]", string.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tests whether the file is a cover image such that: contains "cover", is named "folder", and is an image
|
/// Tests whether the file is a cover image such that: contains "cover", is named "folder", and is an image
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user