Skip the migration and use ffi/util.joinPath() to join paths

This commit is contained in:
Harm te Molder
2025-06-30 07:37:33 +02:00
parent 60c743d9b1
commit 2d05dc9b0b
2 changed files with 6 additions and 28 deletions

View File

@@ -114,7 +114,7 @@ function Wallabag:init()
self.archive_directory = self.wb_settings.data.wallabag.archive_directory
if not self.archive_directory or self.archive_directory == "" then
if self.directory and self.directory ~= "" then
self.archive_directory = self.directory.."/archive"
self.archive_directory = FFIUtil.joinPath(self.directory, "archive")
end
end
@@ -757,7 +757,7 @@ function Wallabag:downloadArticle(article)
end
end
local local_path = self.directory.."/"..article_id_prefix..article.id..article_id_postfix..title..file_ext
local local_path = FFIUtil.joinPath(self.directory, article_id_prefix..article.id..article_id_postfix..title..file_ext)
logger.dbg("Wallabag:downloadArticle: downloading", article.id, "to", local_path)
local attr = lfs.attributes(local_path)
@@ -1079,7 +1079,7 @@ function Wallabag:processRemoteDeletes(remote_ids)
local count = 0
for entry in lfs.dir(self.directory) do
local entry_path = self.directory.."/"..entry
local entry_path = FFIUtil.joinPath(self.directory, entry)
if entry ~= "." and entry ~= ".." and lfs.attributes(entry_path, "mode") == "file" then
local local_id = self:getArticleID(entry_path)
@@ -1128,7 +1128,7 @@ function Wallabag:uploadStatuses(quiet)
local skip = false
if entry ~= "." and entry ~= ".." then
local entry_path = self.directory.."/"..entry
local entry_path = FFIUtil.joinPath(self.directory, entry)
if DocSettings:hasSidecarFile(entry_path) then
logger.dbg("Wallabag:uploadStatuses:", entry_path, "has sidecar file")
@@ -1324,7 +1324,7 @@ function Wallabag:archiveLocalArticle(path)
if lfs.attributes(path, "mode") == "file" then
local _, file = util.splitFilePathName(path)
local new_path = self.archive_directory.."/"..file
local new_path = FFIUtil.joinPath(self.archive_directory, file)
if FileManager:moveFile(path, new_path) then
result = 1
end