mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
1c79ef272f
commit
daf37f74b4
@ -5,11 +5,13 @@ import android.content.Intent
|
||||
import io.legado.app.App
|
||||
import io.legado.app.R
|
||||
import io.legado.app.base.BaseViewModel
|
||||
import io.legado.app.constant.EventBus
|
||||
import io.legado.app.data.entities.Book
|
||||
import io.legado.app.data.entities.BookChapter
|
||||
import io.legado.app.help.BookHelp
|
||||
import io.legado.app.model.webBook.WebBook
|
||||
import io.legado.app.service.help.AudioPlay
|
||||
import io.legado.app.utils.postEvent
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
||||
class AudioPlayViewModel(application: Application) : BaseViewModel(application) {
|
||||
@ -30,6 +32,9 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application)
|
||||
AudioPlay.coverData.postValue(book.getDisplayCover())
|
||||
AudioPlay.durChapterIndex = book.durChapterIndex
|
||||
AudioPlay.durPageIndex = book.durChapterPos
|
||||
App.db.bookChapterDao().getChapter(book.bookUrl, book.durChapterIndex)?.let {
|
||||
postEvent(EventBus.AUDIO_SUB_TITLE, it.title)
|
||||
}
|
||||
App.db.bookSourceDao().getBookSource(book.origin)?.let {
|
||||
AudioPlay.webBook = WebBook(it)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user