fix: webDav服务器的config和webDavConfig定义不同

This commit is contained in:
Xwite
2023-03-06 17:16:40 +08:00
committed by Xwite
parent dd5b0567dd
commit 9631039b1e
3 changed files with 3 additions and 3 deletions
@@ -44,7 +44,7 @@ data class Server(
} }
fun getWebDavConfig(): WebDavConfig? { fun getWebDavConfig(): WebDavConfig? {
return GSON.fromJsonObject<WebDavConfig>(config).getOrNull() return if (type == TYPE.WEBDAV) GSON.fromJsonObject<WebDavConfig>(config).getOrNull() else null
} }
@Parcelize @Parcelize
@@ -26,7 +26,7 @@ data class Authorization(
serverID ?: throw NoStackTraceException("Unexpected server ID") serverID ?: throw NoStackTraceException("Unexpected server ID")
appDb.serverDao.get(serverID)?.getWebDavConfig().run { appDb.serverDao.get(serverID)?.getWebDavConfig().run {
data = Credentials.basic(username, password, charset) data = Credentials.basic(username, password, charset)
} } ?: throw WebDavException("Unexpected WebDav Authorization")
} }
} }
@@ -27,7 +27,7 @@ class ServerConfigDialog : BaseDialogFragment(R.layout.dialog_webdav_server, tru
private val serverUi = listOf( private val serverUi = listOf(
RowUi("url"), RowUi("url"),
RowUi("user"), RowUi("username"),
RowUi("password", RowUi.Type.password) RowUi("password", RowUi.Type.password)
) )