Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
C# annotationscbzcomicinfocomicscomics-readercross-platformcsharpepubepub-readerfreelinuxmangamedia-servermetadataopdsopds-feedpdfself-hostedubooquitywindows
Some smells found in scan.
Joseph Milazzoa176034905ff
diff --git a/API/Interfaces/Services/IDirectoryService.cs b/API/Interfaces/Services/IDirectoryService.csindex c22fa1189..f9e8345bd 100644--- a/API/Interfaces/Services/IDirectoryService.cs+++ b/API/Interfaces/Services/IDirectoryService.cs@@ -20,19 +20,6 @@ namespace API.Interfaces.Services/// <returns></returns>string[] GetFilesWithExtension(string path, string searchPatternExpression = "");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 Exists(string directory);diff --git a/API/Services/ArchiveService.cs b/API/Services/ArchiveService.csindex c10517d82..3cda2b4a1 100644--- a/API/Services/ArchiveService.cs+++ b/API/Services/ArchiveService.cs@@ -80,7 +80,7 @@ namespace API.Services{_logger.LogDebug("Using SharpCompress compression handling");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:_logger.LogError("[GetNumberOfPagesFromArchive] This archive cannot be read: {ArchivePath}. Defaulting to 0 pages", archivePath);diff --git a/API/Services/MetadataService.cs b/API/Services/MetadataService.csindex ccde75ae0..4c1dbc118 100644--- a/API/Services/MetadataService.cs+++ b/API/Services/MetadataService.cs@@ -62,7 +62,7 @@ namespace API.Servicespublic 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.if (series == null) return;if (ShouldFindCoverImage(series.CoverImage, forceUpdate))