From d8c48a53fe3f2d7f7f9a5d8c71b8397e3fac0918 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 17 Aug 2012 16:12:37 -0400 Subject: [PATCH] CC-1665: Scheduled stream rebroadcasting and recording -take care of situation where stream metadata has apostrophe in it. --- python_apps/pypo/liquidsoap_scripts/ls_lib.liq | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq index c0b757611..119283753 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq @@ -7,6 +7,9 @@ end def notify_stream(m) 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) command = "/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --webstream='#{json_str}' --media-id=#{!current_dyn_id} &" log(command) system(command)