From c95733191a825d36fe60e263208cf650a4a95931 Mon Sep 17 00:00:00 2001 From: jo Date: Mon, 20 Feb 2023 17:53:37 +0100 Subject: [PATCH] refactor(playout): rename web_stream variables --- playout/libretime_playout/liquidsoap/1.4/ls_lib.liq | 12 ++++++------ .../libretime_playout/liquidsoap/1.4/ls_script.liq | 11 +++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/playout/libretime_playout/liquidsoap/1.4/ls_lib.liq b/playout/libretime_playout/liquidsoap/1.4/ls_lib.liq index cab734db6..b30da066d 100644 --- a/playout/libretime_playout/liquidsoap/1.4/ls_lib.liq +++ b/playout/libretime_playout/liquidsoap/1.4/ls_lib.liq @@ -15,13 +15,13 @@ def notify_queue(m) end def notify_stream(m) - if !current_dyn_id != "-1" then + if !web_stream_id != "-1" then json_str = string.replace(pattern="\n",(fun (s) -> ""), json_of(m)) #if a string has a single apostrophe in it, let's comment it out by ending the string before right before it #escaping the apostrophe, and then starting a new string right after it. This is why we use 3 apostrophes. json_str = string.replace(pattern="'",(fun (s) -> "'\''"), json_str) - gateway("webstream '#{!current_dyn_id}' '#{json_str}'") + gateway("webstream '#{!web_stream_id}' '#{json_str}'") end end @@ -234,12 +234,12 @@ def clear_queue(s) end def set_dynamic_source_id(id) = - current_dyn_id := id - string_of(!current_dyn_id) + web_stream_id := id + string_of(!web_stream_id) end def get_dynamic_source_id() = - string_of(!current_dyn_id) + string_of(!web_stream_id) end #cc-4633 @@ -393,7 +393,7 @@ def http_fallback(~http_input_id,~http,~default) track_sensitive=false, transitions=[to_live,to_static], [(# make sure it is connected, and not buffering - {connected() and source.is_ready(http) and !webstream_enabled}, http), + {connected() and source.is_ready(http) and !web_stream_enabled}, http), ({true},default)]) end diff --git a/playout/libretime_playout/liquidsoap/1.4/ls_script.liq b/playout/libretime_playout/liquidsoap/1.4/ls_script.liq index c49527678..2ef12912a 100644 --- a/playout/libretime_playout/liquidsoap/1.4/ls_script.liq +++ b/playout/libretime_playout/liquidsoap/1.4/ls_script.liq @@ -2,9 +2,8 @@ boot_timestamp = interactive.string("boot_timestamp", string_of(gettimeofday())) #Dynamic source list #dyn_sources = ref [] -webstream_enabled = ref false - -current_dyn_id = ref '-1' +web_stream_enabled = ref false +web_stream_id = ref '-1' show_name = interactive.string("show_name", "") @@ -85,13 +84,13 @@ server.register(namespace="dynamic_source", usage='start', "output_start", fun (s) -> begin log("dynamic_source.output_start") - notify([("schedule_table_id", !current_dyn_id)]) - webstream_enabled := true "enabled" end) + notify([("schedule_table_id", !web_stream_id)]) + web_stream_enabled := true "enabled" end) server.register(namespace="dynamic_source", description="Enable webstream output", usage='stop', "output_stop", - fun (s) -> begin log("dynamic_source.output_stop") webstream_enabled := false "disabled" end) + fun (s) -> begin log("dynamic_source.output_stop") web_stream_enabled := false "disabled" end) server.register(namespace="dynamic_source", description="Set the streams cc_schedule row id",