CC-2661: Uptrade script for stream config feature

- codes for conserving user's liquidsoap.cfg and porting into new stream
setting config.
- extra fix: fixed a bug with shoutcast(default value has to be set for
some variables)
This commit is contained in:
James 2011-09-01 16:02:06 -04:00
parent 17e7e9b80a
commit 39b688c256
11 changed files with 125 additions and 26 deletions

View file

@ -139,10 +139,10 @@ try:
buffer += temp
buffer += "\n"
fh.write(buffer)
fh.write("output_icecast_vorbis_metadata = false\n");
fh.write("log_file = \"/var/log/airtime/pypo-liquidsoap/<script>.log\"\n");
fh.close()
else:
print "Unable to connect to the Airtime server."
print "Waiting for processes to start..."
p = Popen("/etc/init.d/airtime-playout start", shell=True)
sts = os.waitpid(p.pid, 0)[1]

View file

@ -58,4 +58,4 @@ s3_genre = "genre"
# when the metadata changes to a new track. Some versions of
# mplayer and VLC have this problem. Enable this option at your
# own risk!
output_icecast_vorbis_metadata = false
icecast_vorbis_metadata = false

View file

@ -80,7 +80,7 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de
end
else
source = ref s
if not output_icecast_vorbis_metadata then
if not icecast_vorbis_metadata then
source := add(normalize=false, [amplify(0.00001, noise()),s])
end
if bitrate == 24 then
@ -112,15 +112,30 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de
if user == "" then
user_ref := "source"
end
description_ref = ref description
if description == "" then
description_ref := "N/A"
end
genre_ref = ref genre
if genre == "" then
genre_ref := "N/A"
end
url_ref = ref url
if url == "" then
url_ref := "N/A"
end
output.shoutcast = output.shoutcast(host = host,
port = port,
password = pass,
fallible = true,
restart = true,
restart_delay = 5,
url = url,
genre = genre,
name = description,
url = !url_ref,
genre = !genre_ref,
name = !description_ref,
user = !user_ref)
if bitrate == 24 then
ignore(output.shoutcast(%mp3(bitrate = 24),s))

View file

@ -140,7 +140,7 @@ class PypoFetch(Thread):
logger.info("Looking for changes...")
# look for changes
for s in setting:
if "output_sound_device" in s[u'keyname']:
if "output_sound_device" in s[u'keyname'] or "icecast_vorbis_metadata" in s[u'keyname']:
dump, stream = s[u'keyname'].split('_', 1)
state_change_restart[stream] = False
# This is the case where restart is required no matter what
@ -196,7 +196,6 @@ class PypoFetch(Thread):
buffer += temp
buffer += "\n"
fh.write(buffer)
fh.write("output_icecast_vorbis_metadata = false\n");
fh.write("log_file = \"/var/log/airtime/pypo-liquidsoap/<script>.log\"\n");
fh.close()
# restarting pypo.