From 0027af2d367d756778c72672142cc880b7385589 Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 15 Jun 2025 23:07:34 +0200 Subject: [PATCH] Fix: First startup coverImageCache does not exist (on stale check) --- API/Tranga.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/API/Tranga.cs b/API/Tranga.cs index 70d3b9a..ff2da30 100644 --- a/API/Tranga.cs +++ b/API/Tranga.cs @@ -34,7 +34,9 @@ public static class Tranga internal static void RemoveStaleFiles(PgsqlContext context) { - Log.Info($"Removing stale files..."); + Log.Info("Removing stale files..."); + if (!Directory.Exists(TrangaSettings.coverImageCache)) + return; string[] usedFiles = context.Mangas.Select(m => m.CoverFileNameInCache).Where(s => s != null).ToArray()!; string[] extraneousFiles = new DirectoryInfo(TrangaSettings.coverImageCache).GetFiles() .Where(f => usedFiles.Contains(f.FullName) == false)