mirror of
https://github.com/gedoor/legado.git
synced 2025-01-08 11:47:32 +08:00
优化
This commit is contained in:
parent
9d13b353b8
commit
9edc02f696
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@
|
||||
local.properties
|
||||
.DS_Store
|
||||
/build
|
||||
build/
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
/release
|
||||
|
@ -73,7 +73,7 @@ object AppWebDav {
|
||||
WebDav(bookProgressUrl, mAuthorization).makeAsDir()
|
||||
WebDav(exportsWebDavUrl, mAuthorization).makeAsDir()
|
||||
WebDav(bgWebDavUrl, mAuthorization).makeAsDir()
|
||||
val rootBooksUrl = "${rootWebDavUrl}books"
|
||||
val rootBooksUrl = "${rootWebDavUrl}books/"
|
||||
defaultBookWebDav = RemoteBookWebDav(rootBooksUrl, mAuthorization)
|
||||
authorization = mAuthorization
|
||||
}
|
||||
|
@ -178,13 +178,14 @@ open class WebDav(
|
||||
//依然是优化支持 caddy 自建的 WebDav ,其目录后缀都为“/”, 所以删除“/”的判定,不然无法获取该目录项
|
||||
val href = element.findNS("href", ns)[0].text().replace("+", "%2B")
|
||||
val hrefDecode = URLDecoder.decode(href, "UTF-8")
|
||||
.removeSuffix("/")
|
||||
val fileName = hrefDecode.substringAfterLast("/")
|
||||
val webDavFile: WebDav
|
||||
try {
|
||||
val urlName = hrefDecode.ifEmpty {
|
||||
url.file.replace("/", "")
|
||||
}
|
||||
val displayName = element
|
||||
.findNS("displayname", ns)
|
||||
.firstOrNull()?.text().orEmpty()
|
||||
val contentType = element
|
||||
.findNS("getcontenttype", ns)
|
||||
.firstOrNull()?.text().orEmpty()
|
||||
@ -206,7 +207,7 @@ open class WebDav(
|
||||
webDavFile = WebDavFile(
|
||||
fullURL,
|
||||
authorization,
|
||||
displayName = fileName,
|
||||
displayName = displayName,
|
||||
urlName = urlName,
|
||||
size = size,
|
||||
contentType = contentType,
|
||||
|
Loading…
Reference in New Issue
Block a user