From: Steinar H. Gunderson Date: Sun, 28 Oct 2018 15:55:08 +0000 (+0100) Subject: Fix some flickering in the IPTV title. X-Git-Url: https://git.sesse.net/?p=ultimatescore;a=commitdiff_plain;h=3cbff58db6dfd4a887cea57a1de48d66906b127e Fix some flickering in the IPTV title. --- diff --git a/nageru/ultimate.lua b/nageru/ultimate.lua index 8b2b7f1..49b52fa 100644 --- a/nageru/ultimate.lua +++ b/nageru/ultimate.lua @@ -44,12 +44,17 @@ replay_title = "IPTV" cq:wrap(function() while true do local headers, stream = assert(http_request.new_from_uri(futatabi_server .. "/queue_status"):go()) - replay_title = "IPTV" - if headers:get ":status" == "200" then - local body = assert(stream:get_body_as_string()) + if headers:get(":status") == "200" then + local body = stream:get_body_as_string() if body then replay_title = "IPTV (" .. body .. ")" + else + replay_title = "IPTV" + print(futatabi_server .. ": Empty body on HTTP request") end + else + replay_title = "IPTV" + print(futatabi_server .. ": HTTP error " .. headers:get(":status")) end end end)