Open maliayas opened 3 years ago
For future readers, this patch does the job:
diff --git a/bookmarker-menu.lua b/bookmarker-menu.lua
index 848d309..079ee05 100644
--- a/bookmarker-menu.lua
+++ b/bookmarker-menu.lua
@@ -31,6 +31,8 @@ local mode = "none"
local bookmarkStore = {}
local oldSlot = 0
+CONFIG_ROOT = utils.split_path(mp.find_config_file("."))
+
-- // Controls \\ --
-- List of custom controls and their function
@@ -262,11 +264,7 @@ end
-- Get the filepath of a file from the mpv config folder
function getFilepath(filename)
- if isWindows() then
- return os.getenv("APPDATA"):gsub("\\", "/") .. "/mpv/" .. filename
- else
- return os.getenv("HOME") .. "/.config/mpv/" .. filename
- end
+ return CONFIG_ROOT .. filename
end
-- Load a table from a JSON file
is there a way to force bookmarker json to be created in the portable folder? rather than the appdata folder
For future readers, this patch does the job:
diff --git a/bookmarker-menu.lua b/bookmarker-menu.lua index 848d309..079ee05 100644 --- a/bookmarker-menu.lua +++ b/bookmarker-menu.lua @@ -31,6 +31,8 @@ local mode = "none" local bookmarkStore = {} local oldSlot = 0 +CONFIG_ROOT = utils.split_path(mp.find_config_file(".")) + -- // Controls \\ -- -- List of custom controls and their function @@ -262,11 +264,7 @@ end -- Get the filepath of a file from the mpv config folder function getFilepath(filename) - if isWindows() then - return os.getenv("APPDATA"):gsub("\\", "/") .. "/mpv/" .. filename - else - return os.getenv("HOME") .. "/.config/mpv/" .. filename - end + return CONFIG_ROOT .. filename end -- Load a table from a JSON file ```Where does this go in the lua file? can you just post the whole modified lua? thanks.
mp.find_config_file()
seems to be an undocumented function. It doesn't appear in the manual; maybe it has been, or will be removed, so I wouldn't recommend this.
Portable mpv installation uses
portable_config
folder in the root of mpv installation for storing personal data. This plugin might detect that and use that folder in order to storebookmarker.json
. Thanks in advance.