Skip to content

Commit

Permalink
Makes shot_path configurable, fixes #13
Browse files Browse the repository at this point in the history
  • Loading branch information
datasone committed Feb 1, 2023
1 parent 3687f31 commit af9695f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions notify_media.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
debug=no
# Path to executable (MPVMediaControl.exe)
binary_path=~~/bin/MPVMediaControl.exe
# Path for storing temporary screenshots
shot_path=~~/
# If you want to delay taking screenshot for videos, set this to the number of delayed seconds
delayed_sec=3
# Name of mpv's input-ipc-server (defaults to mpvsocket_{pid}), it shall be useful when multiple scripts set up the IPC socket for controls.
Expand Down
6 changes: 4 additions & 2 deletions notify_media.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ local o = {
debug = false,
-- Path to executable (MPVMediaControl.exe)
binary_path = "~~/bin/MPVMediaControl.exe",
-- Path for storing temporary screenshots
shot_path = "~~/",
-- If you want to delay taking screenshot for videos, set this to the number of delayed seconds
delayed_sec = 3,
-- Name of mpv's input-ipc-server (defaults to mpvsocket_{pid}), string "{pid}" in the value will be automatically replaced with the ID of mpv process
Expand Down Expand Up @@ -195,8 +197,8 @@ function notify_metadata_updated()
end
path = encode_element(path)

local user_path = mp.command_native({"expand-path", "~~/"})
shot_path = user_path .. "\\" .. pid .. ".jpg"
local shot_dir = mp.command_native({ "expand-path", o.shot_path })
shot_path = shot_dir .. "\\" .. pid .. ".jpg"
if mp.get_property("video-codec") then
save_shot(shot_path)
end
Expand Down

0 comments on commit af9695f

Please sign in to comment.