mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-26 13:49:21 +08:00
Fix a bug that when saving the queue, the current song is not saved
This commit is contained in:
parent
a25a584416
commit
914e072089
6
queue.go
6
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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user