diff --git a/CHANGELOG.md b/CHANGELOG.md index c799b6e93..27d2e4fad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co - Fix mass migration advanced search query building ([@AntsyLich](https://github.com/AntsyLich)) ([#2629](https://github.com/mihonapp/mihon/pull/2629)) - Fix migration dialog migrating to wrong entry ([@AntsyLich](https://github.com/AntsyLich)) ([#2631](https://github.com/mihonapp/mihon/pull/2631)) - Fix migration "Attempt to invoke virtual method" crash ([@AntsyLich](https://github.com/AntsyLich)) ([#2632](https://github.com/mihonapp/mihon/pull/2632)) +- Fix reader "Unable to edit key" error ([@AntsyLich](https://github.com/AntsyLich)) ([#2634](https://github.com/mihonapp/mihon/pull/2634)) ### Other - Fix Kitsu tracker to conform to tracker data structure properly ([@cpiber](https://github.com/cpiber)) ([#2609](https://github.com/mihonapp/mihon/pull/2609)) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt index bbdf85c10..1d47f5b7d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt @@ -6,7 +6,6 @@ import com.jakewharton.disklrucache.DiskLruCache import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.saveTo -import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import logcat.LogPriority import okhttp3.Response @@ -115,7 +114,7 @@ class ChapterCache( fun isImageInCache(imageUrl: String): Boolean { return try { diskCache.get(DiskUtil.hashKeyForDisk(imageUrl)).use { it != null } - } catch (e: IOException) { + } catch (_: IOException) { false } } @@ -147,7 +146,7 @@ class ChapterCache( try { // Get editor from md5 key. val key = DiskUtil.hashKeyForDisk(imageUrl) - editor = diskCache.edit(key) ?: throw IOException("Unable to edit key") + editor = diskCache.edit(key) ?: return // Get OutputStream and write image with Okio. response.body.source().saveTo(editor.newOutputStream(0))