Save config, dummy out rand.Shuffle for now
This commit is contained in:
parent
7795ce0a73
commit
e1fa2f35f2
|
@ -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)
|
||||||
|
|
7
music.go
7
music.go
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user