mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
[skip ci] fix epub
This commit is contained in:
parent
b88bb562ec
commit
04ddde086d
@ -139,6 +139,7 @@ class EpubFile(var book: Book) {
|
|||||||
epubBook?.let { epubBook ->
|
epubBook?.let { epubBook ->
|
||||||
val nextChapterFirstResourceHref = chapter.getVariable("nextUrl")?.substringBeforeLast("#")
|
val nextChapterFirstResourceHref = chapter.getVariable("nextUrl")?.substringBeforeLast("#")
|
||||||
val currentChapterFirstResourceHref = chapter.url.substringBeforeLast("#")
|
val currentChapterFirstResourceHref = chapter.url.substringBeforeLast("#")
|
||||||
|
val isLastChapter = nextChapterFirstResourceHref.isNullOrBlank()
|
||||||
val startFragmentId = chapter.startFragmentId
|
val startFragmentId = chapter.startFragmentId
|
||||||
val endFragmentId = chapter.endFragmentId
|
val endFragmentId = chapter.endFragmentId
|
||||||
val elements = Elements()
|
val elements = Elements()
|
||||||
@ -154,8 +155,8 @@ class EpubFile(var book: Book) {
|
|||||||
elements.add(
|
elements.add(
|
||||||
getBody(res, startFragmentId, endFragmentId)
|
getBody(res, startFragmentId, endFragmentId)
|
||||||
)
|
)
|
||||||
// 是否继续遍历
|
// 不是最后章节 且 已经遍历到下一章节的内容时停止
|
||||||
if (currentChapterFirstResourceHref == nextChapterFirstResourceHref) break
|
if (!isLastChapter && res.href == nextChapterFirstResourceHref) break
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (nextChapterFirstResourceHref != res.href) {
|
if (nextChapterFirstResourceHref != res.href) {
|
||||||
|
Loading…
Reference in New Issue
Block a user