From 47da9600d1a005f3121e5924c3c159aebd422596 Mon Sep 17 00:00:00 2001 From: jp8 Date: Sat, 3 Aug 2019 08:30:05 +0200 Subject: [PATCH] fix "empty folder" when accessing nextcloud webdav (#5171) fix for cloud storage webdav nextcloud "empty folder" problem See https://github.com/koreader/koreader/issues/4879 --- frontend/apps/cloudstorage/webdavapi.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/apps/cloudstorage/webdavapi.lua b/frontend/apps/cloudstorage/webdavapi.lua index dbb354a19..7086ed0ca 100644 --- a/frontend/apps/cloudstorage/webdavapi.lua +++ b/frontend/apps/cloudstorage/webdavapi.lua @@ -102,6 +102,9 @@ function WebDavApi:listFolder(address, user, pass, folder_path) --logger.dbg("WebDav catalog item=", item) -- is the path and filename of the entry. local item_fullpath = item:match("(.*)") + if string.sub( item_fullpath, -1 ) == "/" then + item_fullpath = string.sub( item_fullpath, 1, -2 ) + end local is_current_dir = self:isCurrentDirectory( item_fullpath, address, path ) local item_name = util.urlDecode( FFIUtil.basename( item_fullpath ) ) local item_path = path .. "/" .. item_name