From ae123b4db19b2fb088bb0e4b709c713ec5728ee9 Mon Sep 17 00:00:00 2001 From: tramhao Date: Thu, 8 Apr 2021 23:11:37 +0800 Subject: [PATCH] fix: playing song is saved when queue is empty --- playingbar.go | 3 +++ queue.go | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/playingbar.go b/playingbar.go index 0106c70..6461f9d 100644 --- a/playingbar.go +++ b/playingbar.go @@ -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 diff --git a/queue.go b/queue.go index 624ca34..d75db00 100644 --- a/queue.go +++ b/queue.go @@ -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") }