Remove extraneous covers from imageCache.
This commit is contained in:
parent
238a2775f4
commit
51a6f216af
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user