pull/1514/head
gedoor 3 years ago
parent 9788e13607
commit 2b8c17208b
  1. 16
      app/src/main/java/io/legado/app/model/localBook/TextFile.kt

@ -269,11 +269,17 @@ class TextFile(private val book: Book) {
curOffset += length.toLong()
}
//设置结尾章节
val chapter = BookChapter()
chapter.title = "${blockPos}章(${chapterPos + 1})"
chapter.start = toc.lastOrNull()?.end ?: curOffset
chapter.end = chapter.start!! + bufferStart
toc.add(chapter)
if (bufferStart > 100) {
val chapter = BookChapter()
chapter.title = "${blockPos}章(${chapterPos + 1})"
chapter.start = toc.lastOrNull()?.end ?: curOffset
chapter.end = chapter.start!! + bufferStart
toc.add(chapter)
} else {
toc.lastOrNull()?.let {
it.end = it.end!! + bufferStart
}
}
}
if (toc.isEmpty()) {
return analyze()

Loading…
Cancel
Save