From 1e41958aafcf6c079a1fbff8e55fc1b80668feaf Mon Sep 17 00:00:00 2001 From: christoph-heinrich Date: Sat, 9 Mar 2024 17:10:08 +0100 Subject: [PATCH 1/2] fix: don't trim too much when speed < 1 with playtime-remaining --- src/uosc/main.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uosc/main.lua b/src/uosc/main.lua index c63a8d1b..a614250d 100644 --- a/src/uosc/main.lua +++ b/src/uosc/main.lua @@ -435,7 +435,8 @@ function update_human_times() if state.duration then local speed = state.speed or 1 if options.destination_time == 'playtime-remaining' then - state.destination_time_human = format_time((state.time - state.duration) / speed, state.duration) + local max_seconds = speed >= 1 and state.duration or state.duration / speed + state.destination_time_human = format_time((state.time - state.duration) / speed, max_seconds) elseif options.destination_time == 'total' then state.destination_time_human = format_time(state.duration, state.duration) else From bb7a5da2fd67c4676390c4de7d57cb36e8d751c3 Mon Sep 17 00:00:00 2001 From: christoph-heinrich Date: Sun, 10 Mar 2024 15:38:24 +0100 Subject: [PATCH 2/2] apply remaining time length change to elapsed time --- src/uosc/main.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/uosc/main.lua b/src/uosc/main.lua index a614250d..683f3d08 100644 --- a/src/uosc/main.lua +++ b/src/uosc/main.lua @@ -431,20 +431,21 @@ end function update_human_times() if state.time then - state.time_human = format_time(state.time, state.duration) + local max_seconds = state.duration if state.duration then local speed = state.speed or 1 if options.destination_time == 'playtime-remaining' then - local max_seconds = speed >= 1 and state.duration or state.duration / speed + max_seconds = speed >= 1 and state.duration or state.duration / speed state.destination_time_human = format_time((state.time - state.duration) / speed, max_seconds) elseif options.destination_time == 'total' then - state.destination_time_human = format_time(state.duration, state.duration) + state.destination_time_human = format_time(state.duration, max_seconds) else - state.destination_time_human = format_time(state.time - state.duration, state.duration) + state.destination_time_human = format_time(state.time - state.duration, max_seconds) end else state.destination_time_human = nil end + state.time_human = format_time(state.time, max_seconds) else state.time_human = nil end