|
|
@ -11,7 +11,6 @@ import io.legado.app.help.BookHelp |
|
|
|
import io.legado.app.model.WebBook |
|
|
|
import io.legado.app.model.WebBook |
|
|
|
import io.legado.app.service.help.AudioPlay |
|
|
|
import io.legado.app.service.help.AudioPlay |
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
import kotlinx.coroutines.withContext |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AudioPlayViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
class AudioPlayViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
|
|
|
|
|
|
|
@ -93,9 +92,6 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application) |
|
|
|
AudioPlay.book?.let { |
|
|
|
AudioPlay.book?.let { |
|
|
|
book1.order = it.order |
|
|
|
book1.order = it.order |
|
|
|
App.db.bookDao().delete(it) |
|
|
|
App.db.bookDao().delete(it) |
|
|
|
} |
|
|
|
|
|
|
|
withContext(Dispatchers.Main) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
App.db.bookDao().insert(book1) |
|
|
|
App.db.bookDao().insert(book1) |
|
|
|
AudioPlay.book = book1 |
|
|
|
AudioPlay.book = book1 |
|
|
|