pull/32/head
kunfei 5 years ago
parent 128a1b6a0b
commit b0492a2138
  1. 6
      app/src/main/java/io/legado/app/ui/changesource/ChangeSourceViewModel.kt

@ -54,16 +54,14 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio
WebBook(item).searchBook(name, scope = this@execute) WebBook(item).searchBook(name, scope = this@execute)
.timeout(30000L) .timeout(30000L)
.onSuccess(IO) { .onSuccess(IO) {
it?.let { list -> it?.forEach { searchBook ->
for (searchBook in list) {
if (searchBook.name == name && searchBook.author == author) { if (searchBook.name == name && searchBook.author == author) {
if (searchBook.tocUrl.isEmpty()) { if (searchBook.tocUrl.isEmpty()) {
loadBookInfo(searchBook.toBook()) loadBookInfo(searchBook.toBook())
} else { } else {
loadChapter(searchBook.toBook()) loadChapter(searchBook.toBook())
} }
break return@onSuccess
}
} }
} }
} }

Loading…
Cancel
Save