Save config, dummy out rand.Shuffle for now

This commit is contained in:
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 filepath := configFile
if _, err := os.Stat(filepath); os.IsNotExist(err) { if _, err := os.Stat(filepath); os.IsNotExist(err) {
log.Warn("No stored config file found (%s); loading default settings", filepath) 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) fh, err := os.Open(filepath)

View File

@ -3,7 +3,6 @@ package sonar
import ( import (
"errors" "errors"
"fmt" "fmt"
"math/rand"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"strconv" "strconv"
@ -137,9 +136,9 @@ func (s *Sonar) StartPlaylist() error {
// Shuffle the files. // Shuffle the files.
log.Debug("StartPlaylist: shuffled %d media files", len(files)) log.Debug("StartPlaylist: shuffled %d media files", len(files))
rand.Shuffle(len(files), func(i, j int) { // rand.Shuffle(len(files), func(i, j int) {
files[i], files[j] = files[j], files[i] // files[i], files[j] = files[j], files[i]
}) // })
// Install the playlist and go. // Install the playlist and go.
s.Player.Run(files) s.Player.Run(files)