Update 'sponsorblock_minimal.lua'
This commit is contained in:
parent
713074aea3
commit
cc84f798ad
|
@ -25,10 +25,9 @@ function getranges()
|
|||
if not string.match(sponsors.stdout,"%[(.-)%]") then return end
|
||||
ranges = {}
|
||||
for i in string.gmatch(string.sub(sponsors.stdout,2,-2),"%[(.-)%]") do
|
||||
for k,v in string.gmatch(i,"(%d+.?%d*),(%d+.?%d*)") do
|
||||
k,v = string.match(i,"(%d+.?%d*),(%d+.?%d*)")
|
||||
ranges[k] = v
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -65,17 +64,16 @@ function file_loaded()
|
|||
end
|
||||
|
||||
function toggle()
|
||||
if not ON then
|
||||
mp.observe_property("time-pos", "native", skip_ads)
|
||||
mp.osd_message("[Sponsorblock] on")
|
||||
ON = true
|
||||
return
|
||||
end
|
||||
if ON then
|
||||
mp.unobserve_property(skip_ads)
|
||||
mp.osd_message("[Sponsorblock] off")
|
||||
ON = false
|
||||
return
|
||||
end
|
||||
mp.observe_property("time-pos", "native", skip_ads)
|
||||
mp.osd_message("[Sponsorblock] on")
|
||||
ON = true
|
||||
return
|
||||
end
|
||||
|
||||
mp.register_event("file-loaded", file_loaded)
|
||||
|
||||
|
|
Reference in New Issue