mpv-bookmarker
mpv-bookmarker copied to clipboard
Support for portable mpv installation
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 store bookmarker.json
. Thanks in advance.
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