Unload ranges and turn off on end of file

This commit is contained in:
nixx 2021-08-07 15:11:43 +02:00
parent 3b25399072
commit a6a97fa09c
1 changed files with 8 additions and 0 deletions

View File

@ -77,6 +77,13 @@ function file_loaded()
return return
end end
function end_file()
if not ON then return end
mp.unobserve_property(skip_ads)
ranges = nil
ON = false
end
function toggle() function toggle()
if ON then if ON then
mp.unobserve_property(skip_ads) mp.unobserve_property(skip_ads)
@ -91,3 +98,4 @@ function toggle()
end end
mp.register_event("file-loaded", file_loaded) mp.register_event("file-loaded", file_loaded)
mp.register_event("end-file", end_file)