修复txt章节结尾断码bug

pull/1903/head
kunfei 3 years ago
parent 3767bcb241
commit a5548e8ee6
  1. 4
      app/src/main/java/io/legado/app/model/localBook/TextFile.kt

@ -173,13 +173,13 @@ class TextFile(private val book: Book) {
val qyChapter = BookChapter() val qyChapter = BookChapter()
qyChapter.title = "前言" qyChapter.title = "前言"
qyChapter.start = curOffset qyChapter.start = curOffset
qyChapter.end = chapterLength.toLong() qyChapter.end = curOffset + chapterLength.toLong()
toc.add(qyChapter) toc.add(qyChapter)
} }
//创建当前章节 //创建当前章节
val curChapter = BookChapter() val curChapter = BookChapter()
curChapter.title = matcher.group() curChapter.title = matcher.group()
curChapter.start = chapterLength.toLong() curChapter.start = curOffset + chapterLength.toLong()
toc.add(curChapter) toc.add(curChapter)
} else { //否则就block分割之后,上一个章节的剩余内容 } else { //否则就block分割之后,上一个章节的剩余内容
//获取上一章节 //获取上一章节

Loading…
Cancel
Save