pull/2368/head
kunfei 2 years ago
parent 46a7ab9076
commit 5a26f87a71
  1. 3
      app/src/main/java/io/legado/app/ui/book/remote/RemoteBookViewModel.kt
  2. 3
      app/src/main/java/io/legado/app/ui/book/remote/manager/RemoteBookWebDav.kt

@ -3,6 +3,7 @@ package io.legado.app.ui.book.remote
import android.app.Application
import io.legado.app.base.BaseViewModel
import io.legado.app.constant.AppLog
import io.legado.app.constant.BookType
import io.legado.app.model.localBook.LocalBook
import io.legado.app.ui.book.remote.manager.RemoteBookWebDav
import io.legado.app.utils.toastOnUi
@ -96,7 +97,7 @@ class RemoteBookViewModel(application: Application) : BaseViewModel(application)
val downloadBookPath = RemoteBookWebDav.getRemoteBook(remoteBook)
downloadBookPath?.let {
val localBook = LocalBook.importFile(it)
localBook.origin= "webDav::" + remoteBook.path
localBook.origin = BookType.webDav + remoteBook.path
localBook.save()
remoteBook.isOnBookShelf = true
}

@ -2,6 +2,7 @@ package io.legado.app.ui.book.remote.manager
import android.net.Uri
import io.legado.app.constant.AppPattern.bookFileRegex
import io.legado.app.constant.BookType
import io.legado.app.data.entities.Book
import io.legado.app.exception.NoStackTraceException
import io.legado.app.help.AppWebDav
@ -99,7 +100,7 @@ object RemoteBookWebDav : RemoteBookManager() {
WebDav(putUrl, it).upload(localBookUri.path!!)
}
}
book.origin = "webDav::" + putUrl
book.origin = BookType.webDav + putUrl
book.save()
return true
}

Loading…
Cancel
Save