Skip to content

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.

Fixed a bug where chapter cover images weren't being updated due to a missed not.

Joseph Milazzo7d54923041f3
diff --git a/API/Extensions/FileInfoExtensions.cs b/API/Extensions/FileInfoExtensions.cs
index d96b06de6..82f6e663f 100644
--- a/API/Extensions/FileInfoExtensions.cs
+++ b/API/Extensions/FileInfoExtensions.cs
@@ -10,9 +10,9 @@ namespace API.Extensions
return comparison.Equals(fileInfo.LastWriteTime);
}
- public static bool IsLastWriteOlder(this FileInfo fileInfo, DateTime comparison)
+ public static bool IsLastWriteLessThan(this FileInfo fileInfo, DateTime comparison)
{
- return comparison > fileInfo.LastWriteTime;
+ return fileInfo.LastWriteTime < comparison;
}
}
}
\ No newline at end of file
diff --git a/API/Services/MetadataService.cs b/API/Services/MetadataService.cs
index 405e4c7e1..889bde5f9 100644
--- a/API/Services/MetadataService.cs
+++ b/API/Services/MetadataService.cs
@@ -33,7 +33,7 @@ namespace API.Services
public void UpdateMetadata(Chapter chapter, bool forceUpdate)
{
var firstFile = chapter.Files.OrderBy(x => x.Chapter).FirstOrDefault();
- if (ShouldFindCoverImage(chapter.CoverImage, forceUpdate) && firstFile != null && new FileInfo(firstFile.FilePath).IsLastWriteOlder(firstFile.LastModified))
+ if (ShouldFindCoverImage(chapter.CoverImage, forceUpdate) && firstFile != null && !new FileInfo(firstFile.FilePath).IsLastWriteLessThan(firstFile.LastModified))
{
chapter.Files ??= new List<MangaFile>();
chapter.CoverImage = _archiveService.GetCoverImage(firstFile.FilePath, true);
@@ -53,7 +53,7 @@ namespace API.Services
// Skip calculating Cover Image (I/O) if the chapter already has it set
if (firstChapter == null || ShouldFindCoverImage(firstChapter.CoverImage))
{
- if (firstFile != null && !new FileInfo(firstFile.FilePath).IsLastWriteOlder(firstFile.LastModified))
+ if (firstFile != null && !new FileInfo(firstFile.FilePath).IsLastWriteLessThan(firstFile.LastModified))
{
volume.CoverImage = _archiveService.GetCoverImage(firstFile.FilePath, true);
}