fix: playing song is saved when queue is empty

This commit is contained in:
tramhao 2021-04-08 23:11:37 +08:00
parent ca5051fa13
commit ae123b4db1
2 changed files with 4 additions and 2 deletions

View File

@ -210,6 +210,9 @@ func (p *PlayingBar) setDefault() {
"%s ┣%s┫ %s", "00:00", strings.Repeat("━", width/2), "00:00",
)
p.text.SetText(text)
if p.albumPhoto != nil {
p.albumPhoto.Clear()
}
}
// Skips the current playing song

View File

@ -210,8 +210,7 @@ func (q *Queue) saveQueue() error {
currentSongInQueue = true
}
}
if !currentSongInQueue {
// if !currentSongInQueue && len(q.items) != 0 {
if !currentSongInQueue && len(q.items) != 0 {
hashed := sha1Hex(getName(currentSongPath))
content.WriteString(hashed + "\n")
}