From 445e63ee42c5cee54a930139e71d48ce52745b2f Mon Sep 17 00:00:00 2001 From: Alexander Yakushev Date: Sat, 15 Oct 2011 16:39:19 +0300 Subject: Fix the status switching to disconnected when volume bounds are hit When the volume is tried to set beyond its bounds (for example, make it lower when it's already zero) mpc returned an empty string which was treated like a disconnect. This dirty hack removes the problem. --- awesompd.lua | 8 +++++--- jamendo.lua | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/awesompd.lua b/awesompd.lua index 8db3cb5..1a1e0aa 100644 --- a/awesompd.lua +++ b/awesompd.lua @@ -1,7 +1,7 @@ --------------------------------------------------------------------------- -- @author Alexander Yakushev -- @copyright 2010-2011 Alexander Yakushev --- @release v1.0.7 +-- @release v1.0.8 --------------------------------------------------------------------------- awesompd = {} @@ -278,14 +278,16 @@ end function awesompd:command_volume_up() return function() - self:command("volume +5",self.update_track) + self:command("volume +5") + self:update_track() -- Nasty! I should replace it with proper callback later. self:notify_state(self.NOTIFY_VOLUME) end end function awesompd:command_volume_down() return function() - self:command("volume -5",self.update_track) + self:command("volume -5") + self:update_track() self:notify_state(self.NOTIFY_VOLUME) end end diff --git a/jamendo.lua b/jamendo.lua index 870a421..5af6121 100644 --- a/jamendo.lua +++ b/jamendo.lua @@ -1,7 +1,7 @@ --------------------------------------------------------------------------- -- @author Alexander Yakushev -- @copyright 2011 Alexander Yakushev --- @release v1.0.7 +-- @release v1.0.8 --------------------------------------------------------------------------- module('jamendo', package.seeall) -- cgit v1.2.3