volup/voldown fix for mpd plugin
This commit is contained in:
parent
56b87f3436
commit
cbfcb76c21
1 changed files with 4 additions and 6 deletions
|
@ -151,9 +151,8 @@ class MusicMpdPlugin(MusicPlugin):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
volume = int(self.status().output['volume'])
|
volume = int(self.status().output['volume'])
|
||||||
new_volume = volume+delta
|
new_volume = min(volume+delta, 100)
|
||||||
if new_volume <= 100:
|
self.setvol(str(new_volume))
|
||||||
self.setvol(str(new_volume))
|
|
||||||
return self.status()
|
return self.status()
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
@ -166,9 +165,8 @@ class MusicMpdPlugin(MusicPlugin):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
volume = int(self.status().output['volume'])
|
volume = int(self.status().output['volume'])
|
||||||
new_volume = volume-delta
|
new_volume = max(volume-delta, 0)
|
||||||
if new_volume >= 0:
|
self.setvol(str(new_volume))
|
||||||
self.setvol(str(new_volume))
|
|
||||||
return self.status()
|
return self.status()
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
Loading…
Reference in a new issue