Fixed downloading after revisiting cached manga

This commit is contained in:
tom5079
2022-01-31 13:27:23 +09:00
parent a77b1db749
commit 792f5b5a7f
3 changed files with 6 additions and 4 deletions

View File

@@ -229,8 +229,10 @@ class Cache private constructor(context: Context, val galleryID: Int) : ContextW
return@launch
(lock[galleryID] ?: Mutex().also { lock[galleryID] = it }).withLock {
if (downloadFolder.exists()) downloadFolder.deleteRecursively()
downloadFolder.mkdir()
if (downloadFolder.exists() && downloadFolder.list().isNullOrEmpty()) {
downloadFolder.deleteRecursively()
downloadFolder.mkdir()
}
val cacheMetadata = cacheFolder.getChild(".metadata")
val downloadMetadata = downloadFolder.getChild(".metadata")