diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index e9d371a2d..ac5cac99f 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -98,17 +98,15 @@ object BookHelp { book: Book, bookChapter: BookChapter, content: String - ) { + ) = coroutineScope { val awaitList = arrayListOf>() content.split("\n").forEach { val matcher = AppPattern.imgPattern.matcher(it) if (matcher.find()) { matcher.group(1)?.let { src -> val mSrc = NetworkUtils.getAbsoluteURL(bookChapter.url, src) - awaitList.add(coroutineScope { - async { - saveImage(bookSource, book, mSrc) - } + awaitList.add(async { + saveImage(bookSource, book, mSrc) }) } }