Merge branch '2.4.x'

This commit is contained in:
Naomi 2013-05-27 14:46:48 -04:00
commit 6b12dcdc2a
29 changed files with 744 additions and 410 deletions

View file

@ -138,8 +138,8 @@ class ApiRequest(object):
content_type = f.info().getheader('Content-Type')
response = f.read()
except Exception, e:
self.logger.error('Exception: %s', e)
self.logger.error("traceback: %s", traceback.format_exc())
#self.logger.error('Exception: %s', e)
#self.logger.error("traceback: %s", traceback.format_exc())
raise
try:
@ -149,8 +149,8 @@ class ApiRequest(object):
else:
raise InvalidContentType()
except Exception:
self.logger.error(response)
self.logger.error("traceback: %s", traceback.format_exc())
#self.logger.error(response)
#self.logger.error("traceback: %s", traceback.format_exc())
raise
def req(self, *args, **kwargs):

View file

@ -2,7 +2,7 @@
### BEGIN INIT INFO
# Provides: airtime-media-monitor
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Start: $local_fs $remote_fs $network $syslog $all
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6

View file

@ -2,7 +2,7 @@
### BEGIN INIT INFO
# Provides: airtime-liquidsoap
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Start: $local_fs $remote_fs $network $syslog $all
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6

View file

@ -2,7 +2,7 @@
### BEGIN INIT INFO
# Provides: airtime-playout
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Start: $local_fs $remote_fs $network $syslog $all
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6

View file

@ -1,6 +1,7 @@
import logging
import sys
import time
import traceback
from api_clients.api_client import AirtimeApiClient
def generate_liquidsoap_config(ss):
@ -26,19 +27,21 @@ def generate_liquidsoap_config(ss):
fh.close()
logging.basicConfig(format='%(message)s')
ac = AirtimeApiClient(logging.getLogger())
attempts = 0
max_attempts = 5
max_attempts = 10
successful = False
while True:
while not successful:
try:
ac = AirtimeApiClient(logging.getLogger())
ss = ac.get_stream_setting()
generate_liquidsoap_config(ss)
break
successful = True
except Exception, e:
if attempts == max_attempts:
print "Unable to connect to the Airtime server."
logging.error(str(e))
logging.error("traceback: %s", traceback.format_exc())
sys.exit(1)
else:
time.sleep(3)

View file

@ -40,6 +40,14 @@ source_id = ref 0
def create_source()
l = request.equeue(id="s#{!source_id}", length=0.5)
l = cue_cut(l)
l = audio_to_stereo(id="queue_src", l)
l = amplify(1., override="replay_gain", l)
# the crossfade function controls fade in/out
l = crossfade_airtime(l)
l = on_metadata(notify, l)
sources := list.append([l], !sources)
server.register(namespace="queues",
"s#{!source_id}_skip",
@ -62,12 +70,6 @@ create_source()
queue = add(!sources, normalize=false)
queue = audio_to_stereo(id="queue_src", queue)
queue = amplify(1., override="replay_gain", queue)
# the crossfade function controls fade in/out
queue = crossfade_airtime(queue)
queue = on_metadata(notify, queue)
output.dummy(fallible=true, queue)
http = input.http_restart(id="http")