From be44a81fb6ee31c4dbb794ea33facfd7967b6773 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Sat, 10 Oct 2026 01:55:35 +0600 Subject: [PATCH] Keep listing local chapters when one archive can't be read (#3997) Closes #3997 Fixes #2548 Co-authored-by: AddictToTheKey --- .../tachiyomi/source/local/LocalSource.kt | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/source-local/src/main/kotlin/tachiyomi/source/local/LocalSource.kt b/source-local/src/main/kotlin/tachiyomi/source/local/LocalSource.kt index 79e876eec..6307da865 100644 --- a/source-local/src/main/kotlin/tachiyomi/source/local/LocalSource.kt +++ b/source-local/src/main/kotlin/tachiyomi/source/local/LocalSource.kt @@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SMangaUpdate import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder +import kotlinx.coroutines.CancellationException import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.supervisorScope @@ -304,15 +305,21 @@ class LocalSource( .parseChapterNumber(manga.title, this.name, this.chapter_number.toDouble()) .toFloat() - val format = Format.valueOf(chapterFile) - if (format is Format.Epub) { - format.file.epubReader(context).use { epub -> - epub.fillMetadata(manga, this) - } - } else { - getComicInfoForChapter(chapterFile) { stream -> - setChapterDetailsFromComicInfoFile(stream, this) + try { + val format = Format.valueOf(chapterFile) + if (format is Format.Epub) { + format.file.epubReader(context).use { epub -> + epub.fillMetadata(manga, this) + } + } else { + getComicInfoForChapter(chapterFile) { stream -> + setChapterDetailsFromComicInfoFile(stream, this) + } } + } catch (e: CancellationException) { + throw e + } catch (e: Exception) { + logcat(LogPriority.ERROR, e) { "Failed to read metadata for ${chapterFile.name}" } } } }