|
|
@ -114,8 +114,12 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
App.db.bookChapterDao().insert(*it.toTypedArray()) |
|
|
|
App.db.bookChapterDao().insert(*it.toTypedArray()) |
|
|
|
App.db.bookDao().update(book) |
|
|
|
App.db.bookDao().update(book) |
|
|
|
ReadBook.chapterSize = it.size |
|
|
|
ReadBook.chapterSize = it.size |
|
|
|
ReadBook.upMsg(null) |
|
|
|
if (it.isEmpty()) { |
|
|
|
ReadBook.loadContent(resetPageOffset = true) |
|
|
|
ReadBook.upMsg(context.getString(R.string.error_load_toc)) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
ReadBook.upMsg(null) |
|
|
|
|
|
|
|
ReadBook.loadContent(resetPageOffset = true) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ReadBook.webBook?.getChapterList(book, this) |
|
|
|
ReadBook.webBook?.getChapterList(book, this) |
|
|
|