This commit is contained in:
821938089
2022-08-10 18:49:22 +08:00
parent ca481c6987
commit d2385c38ea

View File

@@ -98,17 +98,15 @@ object BookHelp {
book: Book,
bookChapter: BookChapter,
content: String
) {
) = coroutineScope {
val awaitList = arrayListOf<Deferred<Unit>>()
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)
})
}
}