mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-05-27 10:02:34 -04:00
Bugfix/series cover not setting (#527)
* Fixed an issue where cover generation was failing on first add due to not checking correctly on First Volume.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using API.Comparators;
|
||||
@@ -37,11 +36,6 @@ namespace API.Services
|
||||
_imageService = imageService;
|
||||
}
|
||||
|
||||
private static bool IsCoverImageSet(byte[] coverImage, bool forceUpdate = false)
|
||||
{
|
||||
return forceUpdate || HasCoverImage(coverImage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether an entity should regenerate cover image
|
||||
/// </summary>
|
||||
@@ -104,7 +98,8 @@ namespace API.Services
|
||||
/// <param name="forceUpdate">Force updating cover image even if underlying file has not been modified or chapter already has a cover image</param>
|
||||
public void UpdateMetadata(Volume volume, bool forceUpdate)
|
||||
{
|
||||
if (volume == null || !IsCoverImageSet(volume.CoverImage, forceUpdate)) return;
|
||||
if (volume == null || !ShouldUpdateCoverImage(volume.CoverImage, null, forceUpdate
|
||||
, false)) return;
|
||||
|
||||
volume.Chapters ??= new List<Chapter>();
|
||||
var firstChapter = volume.Chapters.OrderBy(x => double.Parse(x.Number), _chapterSortComparer).FirstOrDefault();
|
||||
|
||||
Reference in New Issue
Block a user