mirror of
https://github.com/gedoor/legado.git
synced 2024-09-03 09:55:00 +08:00
优化
This commit is contained in:
parent
40a1cc60fe
commit
c2a8b9bd8b
@ -45,12 +45,16 @@ object WebDavHelp {
|
||||
val url = getWebDavUrl()
|
||||
val names = arrayListOf<String>()
|
||||
if (!url.isNullOrBlank() && initWebDav()) {
|
||||
var files = WebDav(url + "legado/").listFiles()
|
||||
files = files.reversed()
|
||||
for (index: Int in 0 until min(10, files.size)) {
|
||||
files[index].displayName?.let {
|
||||
names.add(it)
|
||||
try {
|
||||
var files = WebDav(url + "legado/").listFiles()
|
||||
files = files.reversed()
|
||||
for (index: Int in 0 until min(10, files.size)) {
|
||||
files[index].displayName?.let {
|
||||
names.add(it)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
return names
|
||||
}
|
||||
}
|
||||
return names
|
||||
|
Loading…
Reference in New Issue
Block a user