Merge pull request #1516 from Xwite/master

fix:卷正文标题重复
pull/1522/head
kunfei 3 years ago committed by GitHub
commit ab7d6b08ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      app/src/main/java/io/legado/app/model/webBook/WebBook.kt
  2. 2
      app/src/main/java/io/legado/app/service/CheckSourceService.kt
  3. 4
      app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt

@ -262,9 +262,8 @@ object WebBook {
return bookChapter.url return bookChapter.url
} }
if(bookChapter.isVolume && bookChapter.url == bookChapter.title) { if(bookChapter.isVolume && bookChapter.url == bookChapter.title) {
//不返回空值,是为了过书源检测 Debug.log(bookSource.bookSourceUrl, "⇒一级目录获取链接为空,正文返回空白")
Debug.log(bookSource.bookSourceUrl, "⇒一级目录正文,使用章节标题:${bookChapter.title}") return ""
return bookChapter.title
} }
return if (bookChapter.url == book.bookUrl && !book.tocHtml.isNullOrEmpty()) { return if (bookChapter.url == book.bookUrl && !book.tocHtml.isNullOrEmpty()) {
BookContent.analyzeContent( BookContent.analyzeContent(

@ -144,7 +144,7 @@ class CheckSourceService : BaseService() {
nextChapterUrl = nextChapterUrl, nextChapterUrl = nextChapterUrl,
needSave = false needSave = false
) )
if (content.isBlank()) { if ( !toc.first().isVolume && content.isBlank()) {
throw NoStackTraceException("正文内容为空") throw NoStackTraceException("正文内容为空")
} }
}.timeout(180000L) }.timeout(180000L)

@ -332,7 +332,7 @@ object ChapterProvider {
} }
lineIndex == layout.lineCount - 1 -> { lineIndex == layout.lineCount - 1 -> {
//最后一行 //最后一行
textLine.text = if(isVolumeTitle) "" else "$words\n" textLine.text = "$words\n"
isLastLine = true isLastLine = true
//标题居中 //标题居中
val startX = if (isTitle && ReadBookConfig.titleMode == 1 || isVolumeTitle) val startX = if (isTitle && ReadBookConfig.titleMode == 1 || isVolumeTitle)
@ -349,7 +349,7 @@ object ChapterProvider {
} }
else -> { else -> {
//中间行 //中间行
textLine.text = if(isVolumeTitle) "" else words textLine.text = words
addCharsToLineMiddle( addCharsToLineMiddle(
absStartX, absStartX,
textLine, textLine,

Loading…
Cancel
Save