|
|
@ -77,8 +77,8 @@ class RemoteBookViewModel(application: Application) : BaseViewModel(application) |
|
|
|
fun loadRemoteBookList(path: String?, loadCallback: (loading: Boolean) -> Unit) { |
|
|
|
fun loadRemoteBookList(path: String?, loadCallback: (loading: Boolean) -> Unit) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
dataCallback?.clear() |
|
|
|
dataCallback?.clear() |
|
|
|
val path = path ?: RemoteBookWebDav.rootBookUrl |
|
|
|
val url = path ?: RemoteBookWebDav.rootBookUrl |
|
|
|
val bookList = RemoteBookWebDav.getRemoteBookList(path) |
|
|
|
val bookList = RemoteBookWebDav.getRemoteBookList(url) |
|
|
|
dataCallback?.setItems(bookList) |
|
|
|
dataCallback?.setItems(bookList) |
|
|
|
}.onError { |
|
|
|
}.onError { |
|
|
|
AppLog.put("获取webDav书籍出错\n${it.localizedMessage}", it) |
|
|
|
AppLog.put("获取webDav书籍出错\n${it.localizedMessage}", it) |
|
|
|