mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
88476f7a82
commit
a0f5bb6fc0
@ -31,7 +31,12 @@ import io.legado.app.model.webBook.WebBook
|
|||||||
import io.legado.app.service.BaseReadAloudService
|
import io.legado.app.service.BaseReadAloudService
|
||||||
import io.legado.app.ui.book.read.page.entities.TextChapter
|
import io.legado.app.ui.book.read.page.entities.TextChapter
|
||||||
import io.legado.app.ui.book.searchContent.SearchResult
|
import io.legado.app.ui.book.searchContent.SearchResult
|
||||||
import io.legado.app.utils.*
|
import io.legado.app.utils.DocumentUtils
|
||||||
|
import io.legado.app.utils.FileUtils
|
||||||
|
import io.legado.app.utils.isContentScheme
|
||||||
|
import io.legado.app.utils.postEvent
|
||||||
|
import io.legado.app.utils.toStringArray
|
||||||
|
import io.legado.app.utils.toastOnUi
|
||||||
import kotlinx.coroutines.Dispatchers.IO
|
import kotlinx.coroutines.Dispatchers.IO
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileInputStream
|
import java.io.FileInputStream
|
||||||
@ -217,7 +222,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
|
|||||||
AppWebDav.getBookProgress(book)
|
AppWebDav.getBookProgress(book)
|
||||||
?: throw NoStackTraceException("没有进度")
|
?: throw NoStackTraceException("没有进度")
|
||||||
}.onError {
|
}.onError {
|
||||||
AppLog.put("拉取阅读进度失败《${book.name}》", it)
|
AppLog.put("拉取阅读进度失败《${book.name}》\n${it.localizedMessage}", it)
|
||||||
}.onSuccess { progress ->
|
}.onSuccess { progress ->
|
||||||
if (progress.durChapterIndex < book.durChapterIndex ||
|
if (progress.durChapterIndex < book.durChapterIndex ||
|
||||||
(progress.durChapterIndex == book.durChapterIndex
|
(progress.durChapterIndex == book.durChapterIndex
|
||||||
|
@ -11,7 +11,6 @@ fun RequestManager.lifecycle(lifecycle: Lifecycle): RequestManager {
|
|||||||
override fun onResume(owner: LifecycleOwner) = onStart()
|
override fun onResume(owner: LifecycleOwner) = onStart()
|
||||||
override fun onPause(owner: LifecycleOwner) = onStop()
|
override fun onPause(owner: LifecycleOwner) = onStop()
|
||||||
override fun onDestroy(owner: LifecycleOwner) {
|
override fun onDestroy(owner: LifecycleOwner) {
|
||||||
onDestroy()
|
|
||||||
owner.lifecycle.removeObserver(this)
|
owner.lifecycle.removeObserver(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user