#182 Remove covers that have no asssociated Manga
This commit is contained in:
parent
98bd8a983b
commit
e3211b95e2
@ -180,12 +180,9 @@ public class JobBoss : GlobalBase
|
||||
AddMangaToCache(dncJob.manga);
|
||||
}
|
||||
|
||||
HashSet<string> coverFileNames = GetAllCachedManga().Select(manga => manga.coverFileNameInCache!).ToHashSet();
|
||||
foreach (string fileName in Directory.GetFiles(settings.coverImageCache)) //Cleanup Unused Covers
|
||||
{
|
||||
if(!coverFileNames.Any(existingManga => fileName.Contains(existingManga)))
|
||||
string[] coverFiles = Directory.GetFiles(settings.coverImageCache);
|
||||
foreach(string fileName in coverFiles.Where(fileName => !GetAllCachedManga().Any(manga => manga.coverFileNameInCache == fileName)))
|
||||
File.Delete(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
internal void UpdateJobFile(Job job, string? oldFile = null)
|
||||
|
Loading…
Reference in New Issue
Block a user