Delete outdated thumbnails when inserting mangas into database (#739)

In case the database got deleted without deleting cached/downloaded thumbnails, the next time a manga gets inserted, it's possible that a thumbnail was already downloaded for its id.
This then causes mangas to be displayed with incorrect thumbnails due to using the outdated cached/downloaded thumbnails
This commit is contained in:
schroda
2023-10-29 16:02:23 +01:00
committed by GitHub
parent 05707e29d7
commit 6531b80998
3 changed files with 26 additions and 13 deletions

View File

@@ -329,7 +329,7 @@ object Manga {
return fetchMangaThumbnail(mangaId)
}
private fun clearThumbnail(mangaId: Int) {
fun clearThumbnail(mangaId: Int) {
val fileName = mangaId.toString()
clearCachedImage(applicationDirs.tempThumbnailCacheRoot, fileName)