pull/1941/head
kunfei 3 years ago
parent 7efe1e537c
commit cf4ba745f8
  1. 21
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt

@ -12,6 +12,7 @@ import io.legado.app.help.http.CookieStore
import io.legado.app.model.webBook.WebBook import io.legado.app.model.webBook.WebBook
import io.legado.app.utils.* import io.legado.app.utils.*
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withTimeout
import org.jsoup.nodes.Entities import org.jsoup.nodes.Entities
import org.mozilla.javascript.NativeObject import org.mozilla.javascript.NativeObject
import java.net.URL import java.net.URL
@ -712,14 +713,16 @@ class AnalyzeRule(
val book = book as? Book val book = book as? Book
if (bookSource == null || book == null) return if (bookSource == null || book == null) return
runBlocking { runBlocking {
WebBook.preciseSearchAwait(this, bookSource, book.name, book.author) withTimeout(1800000) {
.getOrThrow().let { WebBook.preciseSearchAwait(this, bookSource, book.name, book.author)
book.bookUrl = it.bookUrl .getOrThrow().let {
it.variableMap.forEach { entry -> book.bookUrl = it.bookUrl
book.putVariable(entry.key, entry.value) it.variableMap.forEach { entry ->
book.putVariable(entry.key, entry.value)
}
} }
} WebBook.getBookInfoAwait(this, bookSource, book, false)
WebBook.getBookInfoAwait(this, bookSource, book, false) }
} }
} }
@ -731,7 +734,9 @@ class AnalyzeRule(
val book = book as? Book val book = book as? Book
if (bookSource == null || book == null) return if (bookSource == null || book == null) return
runBlocking { runBlocking {
WebBook.getBookInfoAwait(this, bookSource, book) withTimeout(1800000) {
WebBook.getBookInfoAwait(this, bookSource, book)
}
} }
} }

Loading…
Cancel
Save