Fix: First startup coverImageCache does not exist (on stale check)

This commit is contained in:
2025-06-15 23:07:34 +02:00
parent 1a8f70f501
commit 0027af2d36

View File

@ -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)