webdav: show folders with same name as current folder (#12788)

Closes #12783
This commit is contained in:
Brendan LeFebvre
2024-11-24 02:59:12 -05:00
committed by GitHub
parent 980b50b370
commit 798a64998f

View File

@@ -104,7 +104,7 @@ function WebDavApi:listFolder(address, user, pass, folder_path, folder_mode)
-- <d:href> is the path and filename of the entry.
local item_fullpath = item:match("<[^:]*:href[^>]*>(.*)</[^:]*:href>")
local item_name = ffiUtil.basename(util.htmlEntitiesToUtf8(util.urlDecode(item_fullpath)))
local is_current_dir = item_name == string.sub(folder_path, -#item_name)
local is_current_dir = self.trim_slashes(item_fullpath) == path
local is_not_collection = item:find("<[^:]*:resourcetype%s*/>") or
item:find("<[^:]*:resourcetype></[^:]*:resourcetype>")
local item_path = path .. "/" .. item_name