From 6520aebcdf7466ad450db0baa7c73a2577a46a45 Mon Sep 17 00:00:00 2001 From: Glax Date: Sat, 10 Aug 2024 21:42:09 +0200 Subject: [PATCH] Cleanup MangaCache --- Tranga/Jobs/JobBoss.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tranga/Jobs/JobBoss.cs b/Tranga/Jobs/JobBoss.cs index 26ea8da..c288c14 100644 --- a/Tranga/Jobs/JobBoss.cs +++ b/Tranga/Jobs/JobBoss.cs @@ -195,6 +195,9 @@ public class JobBoss : GlobalBase string[] coverFiles = Directory.GetFiles(settings.coverImageCache); foreach(string fileName in coverFiles.Where(fileName => !GetAllCachedManga().Any(manga => manga.coverFileNameInCache == fileName))) File.Delete(fileName); + string[] mangaFiles = Directory.GetFiles(settings.mangaCacheFolderPath); + foreach(string fileName in mangaFiles.Where(fileName => !GetAllCachedManga().Any(manga => fileName.Split('.')[0] == manga.internalId))) + File.Delete(fileName); } internal void UpdateJobFile(Job job, string? oldFile = null)