mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
9c96fcb1d4
commit
2ddacfd06b
@ -118,15 +118,13 @@ object BookHelp {
|
||||
content: String
|
||||
) = coroutineScope {
|
||||
val awaitList = arrayListOf<Deferred<Unit>>()
|
||||
content.split("\n").forEach {
|
||||
val matcher = AppPattern.imgPattern.matcher(it)
|
||||
while (matcher.find()) {
|
||||
matcher.group(1)?.let { src ->
|
||||
val mSrc = NetworkUtils.getAbsoluteURL(bookChapter.url, src)
|
||||
awaitList.add(async {
|
||||
saveImage(bookSource, book, mSrc)
|
||||
})
|
||||
}
|
||||
val matcher = AppPattern.imgPattern.matcher(content)
|
||||
while (matcher.find()) {
|
||||
matcher.group(1)?.let { src ->
|
||||
val mSrc = NetworkUtils.getAbsoluteURL(bookChapter.url, src)
|
||||
awaitList.add(async {
|
||||
saveImage(bookSource, book, mSrc)
|
||||
})
|
||||
}
|
||||
}
|
||||
awaitList.forEach {
|
||||
|
Loading…
Reference in New Issue
Block a user