feat: 优化代码

pull/141/head
kunfei 5 years ago
parent 3a1920c5ef
commit 3821d7442e
  1. 4
      app/src/main/java/io/legado/app/model/WebBook.kt

@ -84,8 +84,8 @@ class WebBook(val bookSource: BookSource) {
scope: CoroutineScope = Coroutine.DEFAULT,
context: CoroutineContext = Dispatchers.IO
): Coroutine<Book> {
book.type = bookSource.bookSourceType
return Coroutine.async(scope, context) {
book.type = bookSource.bookSourceType
val body =
if (!book.infoHtml.isNullOrEmpty()) {
book.infoHtml
@ -111,8 +111,8 @@ class WebBook(val bookSource: BookSource) {
scope: CoroutineScope = Coroutine.DEFAULT,
context: CoroutineContext = Dispatchers.IO
): Coroutine<List<BookChapter>> {
book.type = bookSource.bookSourceType
return Coroutine.async(scope, context) {
book.type = bookSource.bookSourceType
val body =
if (book.bookUrl == book.tocUrl && !book.tocHtml.isNullOrEmpty()) {
book.tocHtml

Loading…
Cancel
Save