From dd5b1fb488c7cf90356bc783aad64ff05eac5990 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Tue, 31 May 2022 17:48:05 +0800 Subject: [PATCH] fix(LocalBook/EpubFile): load all contents --- .../java/io/legado/app/model/localBook/EpubFile.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 ff5492b17..cf4bc1e3e 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 @@ -134,8 +134,12 @@ class EpubFile(var book: Book) { if (chapter.url.substringBeforeLast("#") == res.href) { elements.add(getBody(res, startFragmentId, endFragmentId)) isChapter = true - //fix https://github.com/gedoor/legado/issues/1927 加载全部内容的bug - if (chapter.isVolume) break + /** + * fix https://github.com/gedoor/legado/issues/1927 加载全部内容的bug + * content src text/000001.html(当前章节) +- * content src text/000001.html#toc_id_x (下一章节) + */ + if (res.href == nextUrl?.substringBeforeLast("#")) break } else if (isChapter) { if (nextUrl.isNullOrBlank() || res.href == nextUrl.substringBeforeLast("#")) { break @@ -314,11 +318,9 @@ class EpubFile(var book: Book) { chapter.startFragmentId = ref.fragmentId chapterList.lastOrNull()?.endFragmentId = chapter.startFragmentId /** - * 二级目录判定 - * content src text/000001.html (二级目录)(上一章节) - * content src text/000001.html#toc_id_x (当前章节) + * 二级目录判定 todo */ - val isVolume = chapter.url.substringBeforeLast("#") == chapterList.lastOrNull()?.url?.substringBeforeLast("#") + val isVolume = false chapterList.lastOrNull()?.isVolume = isVolume chapterList.lastOrNull()?.putVariable("nextUrl", chapter.url) chapterList.add(chapter)