|
|
@ -49,13 +49,14 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio |
|
|
|
.timeout(30000L) |
|
|
|
.timeout(30000L) |
|
|
|
.onSuccess(Dispatchers.IO) { |
|
|
|
.onSuccess(Dispatchers.IO) { |
|
|
|
it?.let { list -> |
|
|
|
it?.let { list -> |
|
|
|
list.map { 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 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|