校验提示优化

This commit is contained in:
Xwite 2022-01-25 09:03:30 +08:00
parent f2a38ba906
commit da53666811
3 changed files with 9 additions and 5 deletions

View File

@ -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"
} }
} }
} }

View File

@ -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()) {

View File

@ -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)