mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-09 22:08:04 -05:00
Redraw Image only if track has changed
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
state *spotify.PlayerState
|
state *spotify.PlayerState
|
||||||
stateLock sync.Mutex
|
stateLock sync.Mutex
|
||||||
|
ctrackId spotify.ID
|
||||||
)
|
)
|
||||||
|
|
||||||
// ProgressBar is a two-lined Box. First line is the BarTitle
|
// ProgressBar is a two-lined Box. First line is the BarTitle
|
||||||
@@ -85,7 +86,10 @@ func RefreshProgress() {
|
|||||||
state = s
|
state = s
|
||||||
stateLock.Unlock()
|
stateLock.Unlock()
|
||||||
if Ui != nil && Ui.CoverArt != nil {
|
if Ui != nil && Ui.CoverArt != nil {
|
||||||
Ui.CoverArt.RefreshState()
|
if s.Item != nil && s.Item.ID != ctrackId {
|
||||||
|
ctrackId = s.Item.ID
|
||||||
|
Ui.CoverArt.RefreshState()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user