2
0

Remove extraneous covers from imageCache.

This commit is contained in:
glax 2023-10-10 22:51:24 +02:00
parent 238a2775f4
commit 51a6f216af

View File

@ -170,6 +170,13 @@ public class JobBoss : GlobalBase
if (job is DownloadNewChapters dncJob) if (job is DownloadNewChapters dncJob)
cachedPublications.Add(dncJob.manga); cachedPublications.Add(dncJob.manga);
} }
HashSet<string> coverFileNames = cachedPublications.Select(manga => manga.coverFileNameInCache!).ToHashSet();
foreach (string fileName in Directory.GetFiles(settings.coverImageCache))
{
if(!coverFileNames.Any(existingManga => fileName.Contains(existingManga)))
File.Delete(fileName);
}
} }
private void UpdateJobFile(Job job) private void UpdateJobFile(Job job)