mirror of
https://github.com/C9Glax/tranga.git
synced 2025-06-23 03:24:15 +02:00
Fix: First startup coverImageCache does not exist (on stale check)
This commit is contained in:
@ -34,7 +34,9 @@ public static class Tranga
|
|||||||
|
|
||||||
internal static void RemoveStaleFiles(PgsqlContext context)
|
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[] usedFiles = context.Mangas.Select(m => m.CoverFileNameInCache).Where(s => s != null).ToArray()!;
|
||||||
string[] extraneousFiles = new DirectoryInfo(TrangaSettings.coverImageCache).GetFiles()
|
string[] extraneousFiles = new DirectoryInfo(TrangaSettings.coverImageCache).GetFiles()
|
||||||
.Where(f => usedFiles.Contains(f.FullName) == false)
|
.Where(f => usedFiles.Contains(f.FullName) == false)
|
||||||
|
Reference in New Issue
Block a user