From 83a7e0eac9126d992523de374149db5e554c27d3 Mon Sep 17 00:00:00 2001 From: Lee Machin Date: Wed, 11 Dec 2013 12:54:55 +0000 Subject: [PATCH] Return unprocessable entity when trying to change volume wrongly --- bin/mpd_client | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/mpd_client b/bin/mpd_client index 4b2bc0c..da9e406 100755 --- a/bin/mpd_client +++ b/bin/mpd_client @@ -123,7 +123,9 @@ module MPDClient put '/control/volume/:value' do content_type 'application/json' - Control.volume(params[:value]) + unless Control.volume(params[:value].to_i) + status 422 + end end end