From a6a97fa09ce81bea65ed913d312d5b3427a600cb Mon Sep 17 00:00:00 2001 From: nixx Date: Sat, 7 Aug 2021 15:11:43 +0200 Subject: [PATCH] Unload ranges and turn off on end of file --- sponsorblock_minimal.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sponsorblock_minimal.lua b/sponsorblock_minimal.lua index 413f60c..cd323dc 100644 --- a/sponsorblock_minimal.lua +++ b/sponsorblock_minimal.lua @@ -77,6 +77,13 @@ function file_loaded() return end +function end_file() + if not ON then return end + mp.unobserve_property(skip_ads) + ranges = nil + ON = false +end + function toggle() if ON then mp.unobserve_property(skip_ads) @@ -91,3 +98,4 @@ function toggle() end mp.register_event("file-loaded", file_loaded) +mp.register_event("end-file", end_file)