mirror of
https://github.com/gedoor/legado.git
synced 2025-01-07 03:06:58 +08:00
优化
This commit is contained in:
parent
07f7f1bf3e
commit
3dec19f0ee
@ -211,7 +211,10 @@ open class WebDav(
|
||||
.toInstant(ZoneOffset.of("+8")).toEpochMilli()
|
||||
}
|
||||
}.getOrNull() ?: 0
|
||||
val fullURL = NetworkUtils.getAbsoluteURL(baseUrl, hrefDecode)
|
||||
var fullURL = NetworkUtils.getAbsoluteURL(baseUrl, hrefDecode)
|
||||
if (WebDavFile.isDir(contentType, resourceType) && !fullURL.endsWith("/")) {
|
||||
fullURL += "/"
|
||||
}
|
||||
webDavFile = WebDavFile(
|
||||
fullURL,
|
||||
authorization,
|
||||
|
@ -16,7 +16,14 @@ class WebDavFile(
|
||||
) : WebDav(urlStr, authorization) {
|
||||
|
||||
val isDir by lazy {
|
||||
contentType == "httpd/unix-directory" || resourceType.lowercase().contains("collection")
|
||||
isDir(contentType, resourceType)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun isDir(contentType: String, resourceType: String): Boolean {
|
||||
return contentType == "httpd/unix-directory"
|
||||
|| resourceType.lowercase().contains("collection")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user