mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
46a7ab9076
commit
5a26f87a71
@ -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…
Reference in New Issue
Block a user