修复ncx文件格式错误的epub解析 (#2395)

* fix(Epub): load all contents when NCX(toc.ncx) parse error
pull/2398/head
Xwite 2 years ago committed by GitHub
parent c52356152a
commit 9c1c39776d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      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++
}

Loading…
Cancel
Save