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

@@ -38,7 +38,7 @@ android {
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 31 targetSdkVersion 31
versionCode 69 versionCode 69
versionName "5.2.24" versionName "5.2.25"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }

View File

@@ -12,7 +12,7 @@
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 69, "versionCode": 69,
"versionName": "5.2.23", "versionName": "5.2.25",
"outputFile": "app-release.apk" "outputFile": "app-release.apk"
} }
], ],

View File

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