CC-2607: Ability to adjust stream bitrate, type, etc from UI

- removed debug code from NowPlayingController
- New Form for streamsetting
- Action created in PreferenceController
This commit is contained in:
James 2011-08-18 13:53:12 -04:00
parent 4f2b2dba6d
commit cf55e92aa3
17 changed files with 701 additions and 103 deletions

View file

@ -114,26 +114,28 @@ try:
p = Popen("update-rc.d airtime-playout defaults >/dev/null 2>&1", shell=True)
sts = os.waitpid(p.pid, 0)[1]
#we should access the DB and generate liquidsoap.cfg under etc/airtime/
# we should access the DB and generate liquidsoap.cfg under etc/airtime/
api_client = api_client.api_client_factory(config)
ss = api_client.get_stream_setting()
data = ss['msg']
fh = open('/etc/airtime/liquidsoap.cfg', 'w')
for d in data:
buffer = d[u'keyname'] + " = "
if(d[u'type'] == 'string'):
temp = d[u'value']
if(temp == ""):
temp = "dummy_string"
buffer += "\"" + temp + "\""
else:
temp = d[u'value']
if(temp == ""):
temp = "0"
buffer += temp
buffer += "\n"
fh.write(buffer)
fh.close()
# if api_client is somehow not working, just use original cfg file
if(ss is not None):
data = ss['msg']
fh = open('/etc/airtime/liquidsoap.cfg', 'w')
for d in data:
buffer = d[u'keyname'] + " = "
if(d[u'type'] == 'string'):
temp = d[u'value']
if(temp == ""):
temp = ""
buffer += "\"" + temp + "\""
else:
temp = d[u'value']
if(temp == ""):
temp = "0"
buffer += temp
buffer += "\n"
fh.write(buffer)
fh.close()
print "Waiting for processes to start..."
p = Popen("/etc/init.d/airtime-playout start", shell=True)