From 914e0720892e3cc2cec452d11d487697276f0d47 Mon Sep 17 00:00:00 2001 From: tramhao Date: Fri, 29 Jan 2021 00:14:50 +0800 Subject: [PATCH] Fix a bug that when saving the queue, the current song is not saved --- queue.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/queue.go b/queue.go index 65b664c..e78054b 100644 --- a/queue.go +++ b/queue.go @@ -202,13 +202,17 @@ func (q *Queue) saveQueue() error { songPaths := q.getItems() var content strings.Builder + + songPath := gomu.player.currentSong.path + hashed := sha1Hex(getName(songPath)) + content.WriteString(hashed + "\n") for _, songPath := range songPaths { // hashed song name is easier to search through hashed := sha1Hex(getName(songPath)) content.WriteString(hashed + "\n") } - + savedPath := expandTilde(q.savedQueuePath) err := ioutil.WriteFile(savedPath, []byte(content.String()), 0644)