commit
bb1f581110
@ -66,6 +66,7 @@ func (s *progressBar) updateProgress() {
|
|||||||
_, _, _width, _ := s.t.GetInnerRect()
|
_, _, _width, _ := s.t.GetInnerRect()
|
||||||
el, err1 := strconv.ParseFloat(_status["elapsed"], 8)
|
el, err1 := strconv.ParseFloat(_status["elapsed"], 8)
|
||||||
du, err := strconv.ParseFloat(_status["duration"], 8)
|
du, err := strconv.ParseFloat(_status["duration"], 8)
|
||||||
|
if du != 0 {
|
||||||
percentage := el / du * 100
|
percentage := el / du * 100
|
||||||
if err == nil && err1 == nil {
|
if err == nil && err1 == nil {
|
||||||
s.t.SetTitle(fmt.Sprintf("[[::i] %s [-:-:-]Shuffle: %s Repeat: %s Volume: %s ]", formatString(_status["state"]), formatString(_status["random"]), formatString(_status["repeat"]), _status["volume"])).SetTitleAlign(tview.AlignRight)
|
s.t.SetTitle(fmt.Sprintf("[[::i] %s [-:-:-]Shuffle: %s Repeat: %s Volume: %s ]", formatString(_status["state"]), formatString(_status["random"]), formatString(_status["repeat"]), _status["volume"])).SetTitleAlign(tview.AlignRight)
|
||||||
@ -74,4 +75,8 @@ func (s *progressBar) updateProgress() {
|
|||||||
s.t.SetTitle(fmt.Sprintf("[[::i] %s [-:-:-]Shuffle: %s Repeat: %s]", formatString(_status["state"]), formatString(_status["random"]), formatString(_status["repeat"]))).SetTitleAlign(tview.AlignRight)
|
s.t.SetTitle(fmt.Sprintf("[[::i] %s [-:-:-]Shuffle: %s Repeat: %s]", formatString(_status["state"]), formatString(_status["random"]), formatString(_status["repeat"]))).SetTitleAlign(tview.AlignRight)
|
||||||
s.t.GetCell(2, 0).Text = ""
|
s.t.GetCell(2, 0).Text = ""
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
s.t.SetTitle(fmt.Sprintf("[[::i] %s [-:-:-]Shuffle: %s Repeat: %s Volume: %s ]", formatString(_status["state"]), formatString(_status["random"]), formatString(_status["repeat"]), _status["volume"])).SetTitleAlign(tview.AlignRight)
|
||||||
|
s.t.GetCell(2, 0).Text = getText(float64(_width), 0, " ---:---")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user