Skip to content

Commit

Permalink
fix: remaining chapter time in top bar wasn't accounting for speed
Browse files Browse the repository at this point in the history
closes #873
  • Loading branch information
tomasklaen committed Mar 12, 2024
1 parent db985f1 commit 581adf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uosc/elements/TopBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ function TopBar:render()
local text = '' .. state.current_chapter.index .. ': ' .. state.current_chapter.title
local next_chapter = state.chapters[state.current_chapter.index + 1]
local chapter_end = next_chapter and next_chapter.time or state.duration or 0
local remaining_time = (state.time and state.time or 0) - chapter_end
local remaining_time = ((state.time and state.time or 0) - chapter_end) / (state.speed or 1)
local remaining_human = format_time(remaining_time, math.abs(remaining_time))
local opts = {
size = font_size,
Expand Down

5 comments on commit 581adf4

@hooke007
Copy link
Contributor

@hooke007 hooke007 commented on 581adf4 Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If destination_timeplaytime-remaining , this value shouldn't be scaled with speed.
https://github.com/tomasklaen/uosc/blob/581adf4c5bf77f32004a2b2e4da9bb393f4781cb/src/uosc.conf#L178C1-L178C36

20240313091306

@tomasklaen
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining time should always be scaled with speed. We don't scale only if we're displaying total time, but this chapter thingy only displays remaining chapter time.

Or do you mean we should display total chapter time when destination_time is time-remaining? Would anyone want that?

@hooke007
Copy link
Contributor

@hooke007 hooke007 commented on 581adf4 Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO. See your description

One of total, playtime-remaining (scaled by the current speed), time-remaining (remaining length of file)

@hooke007
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your can see the img above. It's strange one show 19seconds left while another show 2:49seconds left.

@tomasklaen
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, sorry. I'm moving through these too fast :) I pushed the fix.

Please sign in to comment.