Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: don't trim too much when speed < 1 with playtime-remaining #871

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/uosc/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -431,19 +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
state.destination_time_human = format_time((state.time - state.duration) / speed, state.duration)
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
Expand Down