Randomize track order
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
nemunaire 2022-12-06 21:01:54 +01:00
parent 045a18c3c8
commit a359203c2d

View File

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