Save config, dummy out rand.Shuffle for now

master
Noah 2018-10-24 10:00:28 -07:00
parent 7795ce0a73
commit e1fa2f35f2
2 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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)