mirror of
https://github.com/gedoor/legado.git
synced 2024-09-03 09:55:00 +08:00
优化
This commit is contained in:
parent
b5b5987efe
commit
1ac3a5cef2
@ -39,14 +39,16 @@ object ReadBook {
|
||||
durChapterIndex = book.durChapterIndex
|
||||
durPageIndex = book.durChapterPos
|
||||
isLocalBook = book.origin == BookType.local
|
||||
webBook = null
|
||||
App.db.bookSourceDao().getBookSource(book.origin)?.let {
|
||||
webBook = WebBook(it)
|
||||
}
|
||||
chapterSize = 0
|
||||
prevTextChapter = null
|
||||
curTextChapter = null
|
||||
nextTextChapter = null
|
||||
upWebBook(book.origin)
|
||||
}
|
||||
|
||||
fun upWebBook(origin: String) {
|
||||
val bookSource = App.db.bookSourceDao().getBookSource(origin)
|
||||
webBook = if (bookSource != null) WebBook(bookSource) else null
|
||||
}
|
||||
|
||||
fun moveToNextPage() {
|
||||
|
@ -60,6 +60,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
|
||||
} else {
|
||||
isInitFinish = true
|
||||
ReadBook.titleDate.postValue(book.name)
|
||||
ReadBook.upWebBook(book.origin)
|
||||
ReadBook.chapterSize = App.db.bookChapterDao().getChapterCount(book.bookUrl)
|
||||
if (ReadBook.chapterSize == 0) {
|
||||
if (book.tocUrl.isEmpty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user