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