From 05b327c723f31d864d4e268128097c446bad4e50 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Wed, 22 Apr 2026 12:01:25 +0200 Subject: [PATCH] osc.lua: use the cached chapter_list instead or retrieving chapters --- player/lua/osc.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/player/lua/osc.lua b/player/lua/osc.lua index cd455c4bb0..79b1339b06 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -2371,7 +2371,6 @@ local function osc_init() elements = {} -- some often needed stuff - local have_ch = (mp.get_property_number("chapters", 0) > 0) local loop = mp.get_property("loop-playlist", "no") local ne @@ -2447,14 +2446,14 @@ local function osc_init() --chapter_prev ne = new_element("chapter_prev", "button") - ne.enabled = have_ch + ne.enabled = #state.chapter_list > 0 ne.content = icons.chapter_prev bind_mouse_buttons("chapter_prev") --chapter_next ne = new_element("chapter_next", "button") - ne.enabled = have_ch + ne.enabled = #state.chapter_list > 0 ne.content = icons.chapter_next bind_mouse_buttons("chapter_next")