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