mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-28 12:07:52 +02:00
Bump dependencies
This commit is contained in:
@ -218,6 +218,7 @@ dependencies {
|
||||
implementation(libs.injekt.core)
|
||||
|
||||
// Image loading
|
||||
implementation(platform(libs.coil.bom))
|
||||
implementation(libs.bundles.coil)
|
||||
implementation(libs.subsamplingscaleimageview) {
|
||||
exclude(module = "image-decoder")
|
||||
|
@ -222,18 +222,22 @@ class MangaCoverFetcher(
|
||||
}
|
||||
|
||||
private fun readFromDiskCache(): DiskCache.Snapshot? {
|
||||
return if (options.diskCachePolicy.readEnabled) diskCacheLazy.value[diskCacheKey] else null
|
||||
return if (options.diskCachePolicy.readEnabled) {
|
||||
diskCacheLazy.value.openSnapshot(diskCacheKey)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
private fun writeToDiskCache(
|
||||
response: Response,
|
||||
): DiskCache.Snapshot? {
|
||||
val editor = diskCacheLazy.value.edit(diskCacheKey) ?: return null
|
||||
val editor = diskCacheLazy.value.openEditor(diskCacheKey) ?: return null
|
||||
try {
|
||||
diskCacheLazy.value.fileSystem.write(editor.data) {
|
||||
response.body.source().readAll(this)
|
||||
}
|
||||
return editor.commitAndGet()
|
||||
return editor.commitAndOpenSnapshot()
|
||||
} catch (e: Exception) {
|
||||
try {
|
||||
editor.abort()
|
||||
|
Reference in New Issue
Block a user