-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thumbnail path in portable mpv Windows #49
Comments
I don't know if it's possible currently, but we might be able to use |
Managed to solve it on my own. Thanks for the hint! |
Could you share your solution? |
I made changes so that the script would automatically work for both mpv in portable mode on windows and for mpv-android since this is what I wanted to use it for. I don't know if it works on linux or the normal mpv mode on windows. The changes I made are as follows: thumbs_dir = ON_WINDOWS and "%APPDATA%\\mpv\\gallery-thumbs-dir" or "~/.cache/thumbnails/mpv-gallery/", to thumbs_dir = mp.command_native({ "expand-path", "~~/thumbnails" }), and if ON_WINDOWS then
thumbs_dir = string.gsub(opts.thumbs_dir, "^%%APPDATA%%", os.getenv("APPDATA") or "%APPDATA%")
else
thumbs_dir = string.gsub(opts.thumbs_dir, "^~", os.getenv("HOME") or "~")
end
local res = utils.file_info(thumbs_dir)
if not res or not res.is_dir then
if opts.mkdir_thumbs then
local args = ON_WINDOWS and { "mkdir", thumbs_dir } or { "mkdir", "-p", thumbs_dir }
utils.subprocess({ args = args, playback_only = false })
else
msg.error(string.format("Thumbnail directory \"%s\" does not exist", thumbs_dir))
end
end to thumbs_dir = opts.thumbs_dir
local res = utils.file_info(thumbs_dir)
if not res or not res.is_dir then
if opts.mkdir_thumbs then
if ON_WINDOWS then
os.execute("mkdir " .. thumbs_dir:gsub("/", "\\"))
else
local args = { "mkdir", "-p", thumbs_dir }
utils.subprocess({ args = args, playback_only = false })
end
else
msg.error(string.format("Thumbnail directory \"%s\" does not exist", thumbs_dir))
end
end The use of |
I am using mpv with "portable_config" folder in it. All scripts load fine but I just don't know how to set the thumbnail path in this case. I made a "gallery-thumbs-dir" folder in "portable_config" but it doesn't work. Putting the direct path to "gallery-thumbs-dir" in playlist_view.conf does work but that is not the solution I'm looking for because if I move mpv someplace else I have to do this all over again thus making it not so portable anymore.
The text was updated successfully, but these errors were encountered: