CC-2745: Show status of liquidsoap/icecast connection on Stream Settings
page - initial commit
This commit is contained in:
parent
5b6b81e5f3
commit
d3833f9a32
7 changed files with 156 additions and 22 deletions
|
@ -37,7 +37,17 @@ def to_live(old,new) =
|
|||
end
|
||||
|
||||
|
||||
def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, user, s) =
|
||||
def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, user, s, stream) =
|
||||
def on_error(msg)
|
||||
system("airtime-check-system > ~/temp/temp1.log 2>&1")
|
||||
system("/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --error='#{msg}' --stream-id=#{stream} > ~/temp/temp.log 2>&1")
|
||||
log("/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --error='#{msg}' --stream-id=#{stream}")
|
||||
5.
|
||||
end
|
||||
def on_connect()
|
||||
system("/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --connect --stream-id=#{stream}")
|
||||
log("/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --connect --stream-id=#{stream}")
|
||||
end
|
||||
if output_type == "icecast" then
|
||||
user_ref = ref user
|
||||
if user == "" then
|
||||
|
@ -52,7 +62,9 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de
|
|||
url = url,
|
||||
description = description,
|
||||
genre = genre,
|
||||
user = !user_ref)
|
||||
user = !user_ref,
|
||||
on_error = on_error,
|
||||
on_connect = on_connect)
|
||||
if type == "mp3" then
|
||||
if bitrate == 24 then
|
||||
ignore(output(%mp3(bitrate = 24),s))
|
||||
|
|
|
@ -56,17 +56,18 @@ end
|
|||
|
||||
if s1_output != "disabled" then
|
||||
#output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s)
|
||||
output_to(s1_output, s1_type, s1_bitrate, s1_host, s1_port, s1_pass, s1_mount, s1_url, s1_description, s1_genre, s1_user, s)
|
||||
output_to(s1_output, s1_type, s1_bitrate, s1_host, s1_port, s1_pass, s1_mount, s1_url, s1_description, s1_genre, s1_user, s, "1")
|
||||
end
|
||||
|
||||
if s2_output != "disabled" then
|
||||
#output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s)
|
||||
output_to(s2_output, s2_type, s2_bitrate, s2_host, s2_port, s2_pass, s2_mount, s2_url, s2_description, s2_genre, s2_user, s)
|
||||
output_to(s2_output, s2_type, s2_bitrate, s2_host, s2_port, s2_pass, s2_mount, s2_url, s2_description, s2_genre, s2_user, s, "2")
|
||||
|
||||
end
|
||||
|
||||
if s3_output != "disabled" then
|
||||
#output_to(output_type, type, bitrate, host, port, pass, mount_point, url, description, genre, s)
|
||||
output_to(s3_output, s3_type, s3_bitrate, s3_host, s3_port, s3_pass, s3_mount, s3_url, s3_description, s3_genre, s3_user, s)
|
||||
output_to(s3_output, s3_type, s3_bitrate, s3_host, s3_port, s3_pass, s3_mount, s3_url, s3_description, s3_genre, s3_user, s, "3")
|
||||
end
|
||||
|
||||
ignore(output.dummy(blank()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue