From c9b3f8fda068662f6ed81f611d566f3876fff246 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Sat, 1 Nov 2025 15:03:51 +0600 Subject: [PATCH] Fix reader "Unable to edit key" error (mihonapp/mihon#2634) (cherry picked from commit aef3beb15fb2d4acbde9cb2ea4c5f639606d9fc8) --- .../main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 ad6252472..08ed9197c 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 @@ -13,7 +13,6 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach -import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import logcat.LogPriority import okhttp3.Response @@ -148,7 +147,7 @@ class ChapterCache( fun isImageInCache(imageUrl: String): Boolean { return try { diskCache.get(DiskUtil.hashKeyForDisk(imageUrl)).use { it != null } - } catch (e: IOException) { + } catch (_: IOException) { false } } @@ -180,7 +179,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))