Randomize track order
This commit is contained in:
parent
045a18c3c8
commit
a359203c2d
@ -42,6 +42,10 @@ func WakeUp(cfg *config.Config) (err error) {
|
||||
return fmt.Errorf("Unable to start the player: a player is already running")
|
||||
}
|
||||
|
||||
seed := time.Now().Unix()
|
||||
seed -= seed % 172800
|
||||
rand.Seed(seed)
|
||||
|
||||
CommonPlayer, err = NewPlayer(cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -64,6 +68,7 @@ func NewPlayer(cfg *config.Config) (*Player, error) {
|
||||
MaxRunTime: settings.MaxRunTime * time.Minute,
|
||||
claironTime: settings.GongInterval * time.Minute,
|
||||
claironFile: reveil.CurrentGongPath(cfg),
|
||||
reverseOrder: int(time.Now().Unix()/86400)%2 == 0,
|
||||
}
|
||||
|
||||
// Load our track list
|
||||
|
Loading…
Reference in New Issue
Block a user