mirror of
https://github.com/gedoor/legado.git
synced 2024-07-19 01:17:25 +08:00
优化
This commit is contained in:
parent
456fb0c9f0
commit
6db517eaa1
@ -15,7 +15,6 @@ class FileAssociationViewModel(application: Application) : BaseAssociationViewMo
|
||||
val openBookLiveData = MutableLiveData<String>()
|
||||
val notSupportedLiveData = MutableLiveData<Pair<Uri, String>>()
|
||||
|
||||
@Suppress("BlockingMethodInNonBlockingContext")
|
||||
fun dispatchIndent(uri: Uri) {
|
||||
execute {
|
||||
lateinit var fileName: String
|
||||
@ -42,7 +41,7 @@ class FileAssociationViewModel(application: Application) : BaseAssociationViewMo
|
||||
}
|
||||
}
|
||||
|
||||
fun dispatch(fileDoc: FileDoc) {
|
||||
private fun dispatch(fileDoc: FileDoc) {
|
||||
kotlin.runCatching {
|
||||
if (fileDoc.openInputStream().getOrNull().isJson()) {
|
||||
importJson(fileDoc.uri)
|
||||
|
@ -25,7 +25,6 @@ class TocViewModel(application: Application) : BaseViewModel(application) {
|
||||
}
|
||||
|
||||
fun upBookTocRule(book: Book, finally: () -> Unit) {
|
||||
execute {
|
||||
execute {
|
||||
appDb.bookDao.update(book)
|
||||
LocalBook.getChapterList(book).let {
|
||||
@ -35,7 +34,6 @@ class TocViewModel(application: Application) : BaseViewModel(application) {
|
||||
appDb.bookDao.update(book)
|
||||
bookData.postValue(book)
|
||||
}
|
||||
}
|
||||
}.onFinally {
|
||||
finally.invoke()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user