|
|
@ -111,7 +111,7 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
execute(scope) { |
|
|
|
execute(scope) { |
|
|
|
if (book.isLocalBook()) { |
|
|
|
if (book.isLocalBook()) { |
|
|
|
loadChapter(book, scope) |
|
|
|
loadChapter(book, scope) |
|
|
|
} else if (!isImportBookOnLine) { |
|
|
|
} else { |
|
|
|
bookSource?.let { bookSource -> |
|
|
|
bookSource?.let { bookSource -> |
|
|
|
WebBook.getBookInfo(this, bookSource, book, canReName = canReName) |
|
|
|
WebBook.getBookInfo(this, bookSource, book, canReName = canReName) |
|
|
|
.onSuccess(IO) { |
|
|
|
.onSuccess(IO) { |
|
|
@ -144,6 +144,8 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
appDb.bookChapterDao.insert(*it.toTypedArray()) |
|
|
|
appDb.bookChapterDao.insert(*it.toTypedArray()) |
|
|
|
chapterListData.postValue(it) |
|
|
|
chapterListData.postValue(it) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else if(!isImportBookOnLine) { |
|
|
|
|
|
|
|
chapterListData.postValue(emptyList()) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
bookSource?.let { bookSource -> |
|
|
|
bookSource?.let { bookSource -> |
|
|
|
WebBook.getChapterList(this, bookSource, book) |
|
|
|
WebBook.getChapterList(this, bookSource, book) |
|
|
|