Keep listing local chapters when one archive can't be read (#3997)

Closes #3997
Fixes #2548

Co-authored-by: AddictToTheKey <addicttothekey@local>
This commit is contained in:
AntsyLich
2026-10-10 17:36:20 +06:00
co-authored by AddictToTheKey
parent 88d4071cce
commit be44a81fb6
@@ -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}" }
}
}
}