pull/737/head
gedoor 4 years ago
parent 91504bbe57
commit 778855b7fa
  1. 9
      app/src/main/java/io/legado/app/service/help/ReadBook.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@ -90,10 +90,11 @@ object ReadBook {
nextTextChapter = null
}
fun uploadProgress() {
if (!AppConfig.syncBookProgress) return
book?.let {
BookWebDav.uploadBookProgress(it)
fun uploadProgress(syncBookProgress: Boolean = AppConfig.syncBookProgress) {
if (syncBookProgress) {
book?.let {
BookWebDav.uploadBookProgress(it)
}
}
}

@ -162,8 +162,8 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
}
}
fun syncBookProgress(book: Book) {
if (AppConfig.syncBookProgress)
fun syncBookProgress(book: Book, syncBookProgress: Boolean = AppConfig.syncBookProgress) {
if (syncBookProgress)
execute {
BookWebDav.getBookProgress(book)?.let { progress ->
if (progress.durChapterIndex < book.durChapterIndex ||

Loading…
Cancel
Save