mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
[DocSettingTweak] Use absolute path for document settings (#14418)
External plugins that load files may load them using relative paths instead of absolute paths. This enables these plugins to make use of the per-directory document settings feature.
This commit is contained in:
@@ -93,7 +93,8 @@ function DocSettingTweak:onDocSettingsLoad(doc_settings, document)
|
||||
-- check that the document has not been opened yet & and that we have defaults to customize
|
||||
if document.is_new and directory_defaults.data ~= nil then
|
||||
local base = G_reader_settings:readSetting("home_dir") or filemanagerutil.getDefaultDir()
|
||||
local directory = FFIUtil.dirname(document.file)
|
||||
local absolute_path = FFIUtil.realpath(document.file)
|
||||
local directory = FFIUtil.dirname(absolute_path)
|
||||
-- check if folder matches our defaults to override
|
||||
while directory:sub(1, #base) == base do
|
||||
if directory_defaults:has(directory) then
|
||||
|
||||
Reference in New Issue
Block a user