diff --git a/app/src/main/java/io/legado/app/help/JsExtensions.kt b/app/src/main/java/io/legado/app/help/JsExtensions.kt index 2d3e17208..c307dd82d 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -11,6 +11,7 @@ import io.legado.app.model.Debug import io.legado.app.model.analyzeRule.AnalyzeUrl import io.legado.app.model.analyzeRule.QueryTTF import io.legado.app.utils.* +import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking import org.jsoup.Connection @@ -48,7 +49,7 @@ interface JsExtensions { fun ajaxAll(urlList: List): Array { return runBlocking { val asyncArray = Array(urlList.size) { - async { + async(IO) { val url = urlList[it] val analyzeUrl = AnalyzeUrl(url) analyzeUrl.getStrResponse(url) diff --git a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt index 4ff934735..2e7ebfb38 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt @@ -76,10 +76,10 @@ object BookChapterList { Debug.log(bookSource.bookSourceUrl, "◇目录总页数:${nextUrlList.size}") } else -> { - Debug.log(bookSource.bookSourceUrl, "◇目录总页数:${nextUrlList.size}") + Debug.log(bookSource.bookSourceUrl, "◇并发解析目录,总页数:${chapterData.nextUrl.size}") withContext(IO) { val asyncArray = Array(chapterData.nextUrl.size) { - async { + async(IO) { val urlStr = chapterData.nextUrl[it] val analyzeUrl = AnalyzeUrl( ruleUrl = urlStr,