Redraw Image only if track has changed

This commit is contained in:
aditya-K2
2023-04-13 08:10:08 +05:30
parent 002ad3fc5a
commit b324b9efd7

View File

@@ -17,6 +17,7 @@ import (
var (
state *spotify.PlayerState
stateLock sync.Mutex
ctrackId spotify.ID
)
// ProgressBar is a two-lined Box. First line is the BarTitle
@@ -85,7 +86,10 @@ func RefreshProgress() {
state = s
stateLock.Unlock()
if Ui != nil && Ui.CoverArt != nil {
Ui.CoverArt.RefreshState()
if s.Item != nil && s.Item.ID != ctrackId {
ctrackId = s.Item.ID
Ui.CoverArt.RefreshState()
}
}
}