From 724a70bb96718692c1d05220b3ad3f4ba3bd40e8 Mon Sep 17 00:00:00 2001 From: xurdejl Date: Sun, 20 Oct 2024 17:44:12 +0200 Subject: [PATCH] fix: apply dynamic time format to seekbar tooltip (#62) - Update seekbar tooltip to match MM:SS format for sub-hour positions - Show HH:MM:SS only when seeking past 1-hour mark - Maintain consistency with time display formatting --- modernz.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modernz.lua b/modernz.lua index 9f96131d..d89e53c8 100644 --- a/modernz.lua +++ b/modernz.lua @@ -1917,7 +1917,12 @@ local function osc_init() local duration = mp.get_property_number("duration") if duration ~= nil and pos ~= nil then local possec = duration * (pos / 100) - return mp.format_time(possec) + local time = mp.format_time(possec) + -- If video is less than 1 hour, strip the "00:" prefix + if possec < 3600 then + time = time:gsub("^00:", "") + end + return time else return "" end