volup/voldown fix for mpd plugin

This commit is contained in:
Fabio Manganiello 2018-11-04 01:35:33 +01:00
parent 56b87f3436
commit cbfcb76c21

View file

@ -151,8 +151,7 @@ class MusicMpdPlugin(MusicPlugin):
"""
volume = int(self.status().output['volume'])
new_volume = volume+delta
if new_volume <= 100:
new_volume = min(volume+delta, 100)
self.setvol(str(new_volume))
return self.status()
@ -166,8 +165,7 @@ class MusicMpdPlugin(MusicPlugin):
"""
volume = int(self.status().output['volume'])
new_volume = volume-delta
if new_volume >= 0:
new_volume = max(volume-delta, 0)
self.setvol(str(new_volume))
return self.status()