mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-26 13:49:21 +08:00
fix gomu does not read config volume
This commit is contained in:
parent
a2cc5c2338
commit
05cb4f1534
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user