From e1fa2f35f2080140edbf1f4162211a770ec77ddf Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Wed, 24 Oct 2018 10:00:28 -0700 Subject: [PATCH] Save config, dummy out rand.Shuffle for now --- config.go | 4 +++- music.go | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config.go b/config.go index 9411c2a..8f27f7f 100644 --- a/config.go +++ b/config.go @@ -53,7 +53,9 @@ func LoadConfig() *Config { filepath := configFile if _, err := os.Stat(filepath); os.IsNotExist(err) { log.Warn("No stored config file found (%s); loading default settings", filepath) - return DefaultConfig() + cfg := DefaultConfig() + SaveConfig(cfg) + return cfg } fh, err := os.Open(filepath) diff --git a/music.go b/music.go index fce5fdc..290aeee 100644 --- a/music.go +++ b/music.go @@ -3,7 +3,6 @@ package sonar import ( "errors" "fmt" - "math/rand" "os/exec" "path/filepath" "strconv" @@ -137,9 +136,9 @@ func (s *Sonar) StartPlaylist() error { // Shuffle the files. log.Debug("StartPlaylist: shuffled %d media files", len(files)) - rand.Shuffle(len(files), func(i, j int) { - files[i], files[j] = files[j], files[i] - }) + // rand.Shuffle(len(files), func(i, j int) { + // files[i], files[j] = files[j], files[i] + // }) // Install the playlist and go. s.Player.Run(files)