-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdoccli_skip.lua
29 lines (20 loc) · 967 Bytes
/
doccli_skip.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- Plik doccli
-- Jeżeli aktywowano opcję pomijania, plik zostanie skopiowany do folderu ze skryptami mpv, jeśli nie to nie :D
-- To jeszcze nic nie robi
local mpv = require('mp')
local mpv_options = require("mp.options")
local options = { opening_start = -1, opening_end = -1, ending_start = -1, ending_end = -1 }
mpv_options.read_options(options, "doccli_skip")
local function skip()
local current_time = mp.get_property_number("time-pos")
if not current_time then
return
end
if current_time >= options.opening_start + 2 and current_time < options.opening_start + 3 and options.opening_end ~= -1 then
mp.set_property_number("time-pos", options.opening_end - 3)
end
if current_time >= options.ending_start + 2 and current_time < options.ending_start + 3 and options.ending_end ~= -1 then
mp.set_property_number("time-pos", options.ending_end - 3)
end
end
mp.observe_property("time-pos", "number", skip)