mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Some smells found in scan.
This commit is contained in:
parent
44c2af88ea
commit
a176034905
@ -20,19 +20,6 @@ namespace API.Interfaces.Services
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
string[] GetFilesWithExtension(string path, string searchPatternExpression = "");
|
string[] GetFilesWithExtension(string path, string searchPatternExpression = "");
|
||||||
Task<byte[]> ReadFileAsync(string path);
|
Task<byte[]> ReadFileAsync(string path);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes all files within the directory, then the directory itself.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="directoryPath"></param>
|
|
||||||
//void ClearAndDeleteDirectory(string directoryPath);
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes all files within the directory.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="directoryPath"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
//void ClearDirectory(string directoryPath);
|
|
||||||
|
|
||||||
bool CopyFilesToDirectory(IEnumerable<string> filePaths, string directoryPath);
|
bool CopyFilesToDirectory(IEnumerable<string> filePaths, string directoryPath);
|
||||||
bool Exists(string directory);
|
bool Exists(string directory);
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ namespace API.Services
|
|||||||
{
|
{
|
||||||
_logger.LogDebug("Using SharpCompress compression handling");
|
_logger.LogDebug("Using SharpCompress compression handling");
|
||||||
using var archive = ArchiveFactory.Open(archivePath);
|
using var archive = ArchiveFactory.Open(archivePath);
|
||||||
return archive.Entries.Where(entry => !entry.IsDirectory && Parser.Parser.IsImage(entry.Key)).Count();
|
return archive.Entries.Count(entry => !entry.IsDirectory && Parser.Parser.IsImage(entry.Key));
|
||||||
}
|
}
|
||||||
case ArchiveLibrary.NotSupported:
|
case ArchiveLibrary.NotSupported:
|
||||||
_logger.LogError("[GetNumberOfPagesFromArchive] This archive cannot be read: {ArchivePath}. Defaulting to 0 pages", archivePath);
|
_logger.LogError("[GetNumberOfPagesFromArchive] This archive cannot be read: {ArchivePath}. Defaulting to 0 pages", archivePath);
|
||||||
|
@ -62,7 +62,7 @@ namespace API.Services
|
|||||||
|
|
||||||
public void UpdateMetadata(Series series, bool forceUpdate)
|
public void UpdateMetadata(Series series, bool forceUpdate)
|
||||||
{
|
{
|
||||||
// TODO: this doesn't actually invoke finding a new cover. Also all these should be grouped ideally so we limit
|
// NOTE: this doesn't actually invoke finding a new cover. Also all these should be grouped ideally so we limit
|
||||||
// disk I/O to one method.
|
// disk I/O to one method.
|
||||||
if (series == null) return;
|
if (series == null) return;
|
||||||
if (ShouldFindCoverImage(series.CoverImage, forceUpdate))
|
if (ShouldFindCoverImage(series.CoverImage, forceUpdate))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user