Resolve #1082, #1081 again

This commit is contained in:
tarsin committed 2023-05-17 22:21:17 +08:00
1 parent a2852d6df9
commit b995510df1
1 file changed
+9 -7
@@ -906,13 +906,15 @@ class DownloadsScene :
}
}
coroutineScope.launch {
if (!thumbLocation.exists()) {
thumbLocation.ensureFile()
val key = info.thumbKey!!
imageCache[key]?.use {
UniFile.fromFile(it.data.toFile())!!.openFileDescriptor("r").use { src ->
thumbLocation.openFileDescriptor("w").use { dst ->
src sendTo dst
runCatching {
if (!thumbLocation.exists()) {
thumbLocation.ensureFile()
val key = info.thumbKey!!
imageCache[key]?.use {
UniFile.fromFile(it.data.toFile())!!.openFileDescriptor("r").use { src ->
thumbLocation.openFileDescriptor("w").use { dst ->
src sendTo dst
}
}
}
}