Merge pull request #1558 from Xwite/master

校验提示优化
pull/1560/head^2
kunfei 3 years ago committed by GitHub
commit 538b4cbd3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/src/main/java/io/legado/app/model/Debug.kt
  2. 4
      app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt
  3. 6
      app/src/main/java/io/legado/app/service/CheckSourceService.kt

@ -56,8 +56,8 @@ object Debug {
if (showTime && debugTimeMap[sourceUrl] != null) { if (showTime && debugTimeMap[sourceUrl] != null) {
val time = val time =
debugTimeFormat.format(Date(System.currentTimeMillis() - debugTimeMap[sourceUrl]!!)) debugTimeFormat.format(Date(System.currentTimeMillis() - debugTimeMap[sourceUrl]!!))
printMsg = "$time $printMsg" printMsg = printMsg.substring(1)
debugMessageMap[sourceUrl] = printMsg debugMessageMap[sourceUrl] = "$time $printMsg"
} }
} }
} }

@ -194,10 +194,10 @@ object BookChapterList {
if (bookChapter.url.isEmpty()) { if (bookChapter.url.isEmpty()) {
if (bookChapter.isVolume) { if (bookChapter.isVolume) {
bookChapter.url = bookChapter.title + index bookChapter.url = bookChapter.title + index
Debug.log(bookSource.bookSourceUrl, "一级目录${index}未获取到url,使用${bookChapter.title}${index}替代") Debug.log(bookSource.bookSourceUrl, "一级目录${index}未获取到url,使用标题替代")
} else { } else {
bookChapter.url = baseUrl bookChapter.url = baseUrl
Debug.log(bookSource.bookSourceUrl, "目录${index}未获取到url,使用baseUrl替代") Debug.log(bookSource.bookSourceUrl, "目录${index}未获取到url,使用baseUrl替代")
} }
} }
if (bookChapter.title.isNotEmpty()) { if (bookChapter.title.isNotEmpty()) {

@ -133,8 +133,12 @@ class CheckSourceService : BaseService() {
throw NoStackTraceException("搜索内容为空并且没有发现") throw NoStackTraceException("搜索内容为空并且没有发现")
} }
books = WebBook.exploreBookAwait(this, source, url) books = WebBook.exploreBookAwait(this, source, url)
if (books.isEmpty()) {
throw NoStackTraceException("发现书籍为空")
}
} else {
source.removeGroup("搜索失效")
} }
source.removeGroup("搜索失效")
var book = books.first().toBook() var book = books.first().toBook()
if (book.tocUrl.isBlank()) { if (book.tocUrl.isBlank()) {
book = WebBook.getBookInfoAwait(this, source, book) book = WebBook.getBookInfoAwait(this, source, book)

Loading…
Cancel
Save