|
|
@ -46,11 +46,11 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
private fun initBook(book: Book) { |
|
|
|
private fun initBook(book: Book) { |
|
|
|
if (ReadBook.book?.bookUrl != book.bookUrl) { |
|
|
|
if (ReadBook.book?.bookUrl != book.bookUrl) { |
|
|
|
ReadBook.resetData(book) |
|
|
|
ReadBook.resetData(book) |
|
|
|
|
|
|
|
isInitFinish = true |
|
|
|
if (!book.isLocalBook() && ReadBook.webBook == null) { |
|
|
|
if (!book.isLocalBook() && ReadBook.webBook == null) { |
|
|
|
autoChangeSource(book.name, book.author) |
|
|
|
autoChangeSource(book.name, book.author) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
isInitFinish = true |
|
|
|
|
|
|
|
ReadBook.chapterSize = App.db.bookChapterDao().getChapterCount(book.bookUrl) |
|
|
|
ReadBook.chapterSize = App.db.bookChapterDao().getChapterCount(book.bookUrl) |
|
|
|
if (ReadBook.chapterSize == 0) { |
|
|
|
if (ReadBook.chapterSize == 0) { |
|
|
|
if (book.tocUrl.isEmpty()) { |
|
|
|
if (book.tocUrl.isEmpty()) { |
|
|
|