CC-1665: Scheduled stream rebroadcasting and recording

-take care of situation where stream metadata has apostrophe in it.
This commit is contained in:
Martin Konecny 2012-08-17 16:12:37 -04:00
parent 86ee2966e6
commit d8c48a53fe
1 changed files with 3 additions and 0 deletions

View File

@ -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)