mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
74f2a3f731
commit
1c09bd527c
@ -255,11 +255,12 @@ object Debug {
|
|||||||
private fun tocDebug(scope: CoroutineScope, bookSource: BookSource, book: Book) {
|
private fun tocDebug(scope: CoroutineScope, bookSource: BookSource, book: Book) {
|
||||||
log(debugSource, "︾开始解析目录页")
|
log(debugSource, "︾开始解析目录页")
|
||||||
val chapterList = WebBook.getChapterList(scope, bookSource, book)
|
val chapterList = WebBook.getChapterList(scope, bookSource, book)
|
||||||
.onSuccess {
|
.onSuccess { chapters ->
|
||||||
log(debugSource, "︽目录页解析完成")
|
log(debugSource, "︽目录页解析完成")
|
||||||
log(debugSource, showTime = false)
|
log(debugSource, showTime = false)
|
||||||
val nextChapterUrl = it.getOrNull(1)?.url ?: it.first().url
|
val toc = chapters.filter { !(it.isVolume && it.url.startsWith(it.title)) }
|
||||||
contentDebug(scope, bookSource, book, it.first(), nextChapterUrl)
|
val nextChapterUrl = toc.getOrNull(1)?.url ?: toc.first().url
|
||||||
|
contentDebug(scope, bookSource, book, toc.first(), nextChapterUrl)
|
||||||
}
|
}
|
||||||
.onError {
|
.onError {
|
||||||
log(debugSource, it.stackTraceStr, state = -1)
|
log(debugSource, it.stackTraceStr, state = -1)
|
||||||
|
@ -213,6 +213,7 @@ class CheckSourceService : BaseService() {
|
|||||||
source.bookSourceType != BookSourceType.file
|
source.bookSourceType != BookSourceType.file
|
||||||
) {
|
) {
|
||||||
val toc = WebBook.getChapterListAwait(source, mBook).getOrThrow()
|
val toc = WebBook.getChapterListAwait(source, mBook).getOrThrow()
|
||||||
|
.filter { !(it.isVolume && it.url.startsWith(it.title)) }
|
||||||
val nextChapterUrl = toc.getOrNull(1)?.url ?: toc.first().url
|
val nextChapterUrl = toc.getOrNull(1)?.url ?: toc.first().url
|
||||||
//校验正文
|
//校验正文
|
||||||
if (CheckSource.checkContent) {
|
if (CheckSource.checkContent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user