From 51a26a3cbaadb29d7403773c69737ccda71f5d7e Mon Sep 17 00:00:00 2001 From: Glax Date: Tue, 23 Apr 2024 00:20:34 +0200 Subject: [PATCH] Fix https://github.com/C9Glax/tranga/issues/143 ImageCache could never find files, because they were not in the expected location. --- Tranga/MangaConnectors/MangaConnector.cs | 4 ++-- Tranga/Server.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tranga/MangaConnectors/MangaConnector.cs b/Tranga/MangaConnectors/MangaConnector.cs index 1aa7a50..fdbec1c 100644 --- a/Tranga/MangaConnectors/MangaConnector.cs +++ b/Tranga/MangaConnectors/MangaConnector.cs @@ -175,7 +175,7 @@ public abstract class MangaConnector : GlobalBase return; } - string fileInCache = Path.Join(settings.coverImageCache, manga.coverFileNameInCache); + string fileInCache = manga.coverFileNameInCache ?? Path.Join(settings.coverImageCache, manga.coverFileNameInCache); if (!File.Exists(fileInCache)) { Log($"Cloning cover failed: File missing {fileInCache}."); @@ -299,6 +299,6 @@ public abstract class MangaConnector : GlobalBase coverResult.result.CopyTo(ms); File.WriteAllBytes(saveImagePath, ms.ToArray()); Log($"Saving cover to {saveImagePath}"); - return filename; + return saveImagePath; } } \ No newline at end of file diff --git a/Tranga/Server.cs b/Tranga/Server.cs index 9b99c7a..77e2fba 100644 --- a/Tranga/Server.cs +++ b/Tranga/Server.cs @@ -122,7 +122,7 @@ public class Server : GlobalBase break; } - string filePath = settings.GetFullCoverPath((Manga)manga!); + string filePath = manga?.coverFileNameInCache ?? ""; if (File.Exists(filePath)) { FileStream coverStream = new(filePath, FileMode.Open);