Skip to content

Commit

Permalink
chore(movie): Combine lines when generating progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Sep 3, 2024
1 parent 845eb01 commit 1a15dd7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/movie/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ func (m *Movie) LoadFile(path string, src io.Reader, speed float64) error {
var currentPosition time.Duration
m.Sections = make([]int, m.Width+1)
for i, f := range m.Frames {
f.Progress = bar.Generate(currentPosition+f.Duration/2, totalDuration, m.Width+2)
m.Frames[i] = f
m.Frames[i].Progress = bar.Generate(currentPosition+f.Duration/2, totalDuration, m.Width+2)
percent := int(currentPosition * time.Duration(m.Width) / totalDuration)
if percent < len(m.Sections)-1 {
m.Sections[percent+1] = i
Expand Down

0 comments on commit 1a15dd7

Please # to comment.