下载WebDav书籍前判断是否设置保存路径

pull/2395/head
Xwite 2 years ago committed by GitHub
parent cfacb729c0
commit 4631e6ea01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      app/src/main/java/io/legado/app/model/remote/RemoteBookWebDav.kt

@ -6,6 +6,7 @@ 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
import io.legado.app.help.config.AppConfig
import io.legado.app.lib.webdav.WebDav
import io.legado.app.lib.webdav.WebDavFile
import io.legado.app.model.localBook.LocalBook
@ -58,6 +59,8 @@ object RemoteBookWebDav : RemoteBookManager() {
}
override suspend fun downloadRemoteBook(remoteBook: RemoteBook): Uri {
AppConfig.defaultBookTreeUri
?: throw NoStackTraceException("没有设置书籍保存位置!")
return AppWebDav.authorization?.let {
val webdav = WebDav(remoteBook.path, it)
webdav.downloadInputStream().let { inputStream ->
@ -90,4 +93,4 @@ object RemoteBookWebDav : RemoteBookManager() {
} ?: throw NoStackTraceException("webDav没有配置")
}
}
}

Loading…
Cancel
Save