Fix first chapter in a series not having a cover when K+ replaces series cover

This commit is contained in:
Amelia 2025-05-14 16:43:52 +02:00
parent 8ed2fa3829
commit d9ac52aa0f
No known key found for this signature in database
GPG Key ID: D6D0ECE365407EAA

View File

@ -572,7 +572,13 @@ public class CoverDbService : ICoverDbService
var choseNewImage = string.Equals(betterImage, tempFullPath, StringComparison.OrdinalIgnoreCase);
if (choseNewImage)
{
_directoryService.DeleteFiles([existingPath]);
// Don't delete series cover, unless it's an override, otherwise the first chapter cover will be null
if (existingPath.Contains(ImageService.GetSeriesFormat(series.Id)))
{
_directoryService.DeleteFiles([existingPath]);
}
_directoryService.CopyFile(tempFullPath, finalFullPath);
series.CoverImage = finalFileName;
}