From 9c1c39776d690ee5c5758b4f03b5937c4370b048 Mon Sep 17 00:00:00 2001 From: Xwite <82232510+Xwite@users.noreply.github.com> Date: Sun, 9 Oct 2022 11:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dncx=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF=E7=9A=84epub=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=20(#2395)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Epub): load all contents when NCX(toc.ncx) parse error --- app/src/main/java/io/legado/app/model/localBook/EpubFile.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt b/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt index 1fd9f669a..52f54d313 100644 --- a/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt +++ b/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt @@ -226,6 +226,7 @@ class EpubFile(var book: Book) { epubBook?.let { eBook -> val refs = eBook.tableOfContents.tocReferences if (refs == null || refs.isEmpty()) { + AppLog.put("NCX file parse error, check the epub file") val spineReferences = eBook.spine.spineReferences var i = 0 val size = spineReferences.size @@ -253,6 +254,7 @@ class EpubFile(var book: Book) { } else { chapter.title = title } + chapterList.lastOrNull()?.putVariable("nextUrl", chapter.url) chapterList.add(chapter) i++ }