mpd: workaround command termination bug in mpd server v0.18
See Debian bug report #728982 for more information. Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
This commit is contained in:
parent
c795642c2f
commit
a6a73f47d6
|
@ -37,10 +37,11 @@ local function worker(format, warg)
|
||||||
|
|
||||||
-- Construct MPD client options
|
-- Construct MPD client options
|
||||||
local mpdh = "telnet://"..host..":"..port
|
local mpdh = "telnet://"..host..":"..port
|
||||||
local echo = "echo 'password "..pass.."\nstatus\ncurrentsong\nclose'"
|
local echo = '{ echo "password '..pass..'"; echo "status";' ..
|
||||||
|
'echo "currentsong"; sleep .1; echo "close";}'
|
||||||
|
|
||||||
-- Get data from MPD server
|
-- Get data from MPD server
|
||||||
local f = io.popen(echo.." | curl --connect-timeout 1 -fsm 3 "..mpdh)
|
local f = io.popen(echo.." | curl --connect-timeout 1 -fs "..mpdh)
|
||||||
|
|
||||||
for line in f:lines() do
|
for line in f:lines() do
|
||||||
for k, v in string.gmatch(line, "([%w]+):[%s](.*)$") do
|
for k, v in string.gmatch(line, "([%w]+):[%s](.*)$") do
|
||||||
|
|
Loading…
Reference in New Issue