diff --git a/plugins/wallabag.koplugin/main.lua b/plugins/wallabag.koplugin/main.lua index ba6e4ac32..077afbf95 100644 --- a/plugins/wallabag.koplugin/main.lua +++ b/plugins/wallabag.koplugin/main.lua @@ -1421,15 +1421,11 @@ function Wallabag:archiveLocalArticle(path) if lfs.attributes(path, "mode") == "file" then local _, file = util.splitFilePathName(path) local new_path = ffiUtil.joinPath(self.archive_directory, file) - if path == new_path then -- Already archived + if FileManager:moveFile(path, new_path) then result = true - else - if FileManager:moveFile(path, new_path) then - result = true - end - DocSettings.updateLocation(path, new_path, false) -- move sdr - --- @todo Why is sdr copied instead of moved? end + DocSettings.updateLocation(path, new_path, false) -- move sdr + --- @todo Why is sdr copied instead of moved? end return result @@ -1489,6 +1485,10 @@ function Wallabag:getLocalArticles(dir, map) map = {} end + if dir == self.archive_directory then + return map + end + for entry in lfs.dir(dir) do if entry ~= "." and entry ~= ".." then local entry_path = ffiUtil.joinPath(dir, entry)