fix gomu does not read config volume

This commit is contained in:
raziman 2020-08-02 16:36:47 +08:00
parent a2cc5c2338
commit 05cb4f1534

View File

@ -34,13 +34,13 @@ type Player struct {
}
func newPlayer() *Player {
volume := viper.GetInt("general.volume")
// Read initial volume from config
initVol := absVolume(viper.GetInt("volume"))
initVol := absVolume(volume)
// making sure user does not give invalid volume
if initVol > 100 {
initVol = 100
} else if initVol < 1 {
if volume > 100 || volume < 0 {
initVol = 0
}