From 89983bd4f85bdb669b0f2f1944ef19cc0f97bb4b Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Sun, 24 Mar 2013 22:25:38 -0400 Subject: [PATCH 1/5] remove unnecessary file delete --- python_apps/pypo/airtime-liquidsoap | 2 -- 1 file changed, 2 deletions(-) diff --git a/python_apps/pypo/airtime-liquidsoap b/python_apps/pypo/airtime-liquidsoap index 75821b942..2b8384506 100755 --- a/python_apps/pypo/airtime-liquidsoap +++ b/python_apps/pypo/airtime-liquidsoap @@ -12,8 +12,6 @@ ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq" exec 2>&1 export PYTHONPATH=${api_client_path} -rm -f /etc/airtime/liquidsoap.cfg - cd /usr/lib/airtime/pypo/bin/liquidsoap_scripts python generate_liquidsoap_cfg.py From 38f8a0d23156e4951a64d7cd0a7b13ceb43f1225 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Sun, 24 Mar 2013 22:58:13 -0400 Subject: [PATCH 2/5] more robust handling if system permissions go wrong --- python_apps/pypo/airtime-liquidsoap-init-d | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/python_apps/pypo/airtime-liquidsoap-init-d b/python_apps/pypo/airtime-liquidsoap-init-d index 9826423ef..37956a265 100755 --- a/python_apps/pypo/airtime-liquidsoap-init-d +++ b/python_apps/pypo/airtime-liquidsoap-init-d @@ -35,12 +35,14 @@ stop () { start_no_monit() { chown pypo:pypo /var/log/airtime/pypo chown pypo:pypo /var/log/airtime/pypo-liquidsoap + chown pypo:pypo /etc/airtime/liquidsoap.cfg - touch /var/run/airtime-liquidsoap.pid - chown pypo:pypo /var/run/airtime-liquidsoap.pid + rm -f $PIDFILE + touch $PIDFILE + chown pypo:pypo $PIDFILE start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \ - --pidfile /var/run/airtime-liquidsoap.pid --nicelevel -15 --startas $DAEMON + --pidfile $PIDFILE --nicelevel -15 --startas $DAEMON } @@ -64,8 +66,8 @@ case "${1:-''}" in ;; 'status') - if [ -f "/var/run/airtime-liquidsoap.pid" ]; then - pid=`cat /var/run/airtime-liquidsoap.pid` + if [ -f "$PIDFILE" ]; then + pid=`cat $PIDFILE` if [ -d "/proc/$pid" ]; then echo "Liquidsoap is running" exit 0 From 265ac49f2e52b0c0c9aea1007aa7ed48d8fd147d Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Sun, 24 Mar 2013 23:11:55 -0400 Subject: [PATCH 3/5] remove duplicate cc_config --- airtime_mvc/application/Bootstrap.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index 38d4d9c7a..e289e9c54 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -17,15 +17,12 @@ require_once "Timezone.php"; require_once __DIR__.'/forms/helpers/ValidationTypes.php'; require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php'; - - date_default_timezone_set('UTC'); require_once (APPLICATION_PATH."/logging/Logging.php"); Logging::setLogPath('/var/log/airtime/zendphp.log'); date_default_timezone_set(Application_Model_Preference::GetTimezone()); Config::setAirtimeVersion(); -$CC_CONFIG = Config::getConfig(); require_once __DIR__."/configs/navigation.php"; Zend_Validate::setDefaultNamespaces("Zend"); From d79bfaaef9654006693a39190159d5ca869d9c34 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 26 Mar 2013 15:01:44 -0400 Subject: [PATCH 4/5] -fix infinite loop on invalid files --- python_apps/pypo/media/update/silananalyzer.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/python_apps/pypo/media/update/silananalyzer.py b/python_apps/pypo/media/update/silananalyzer.py index 02b11079a..4d93deddf 100644 --- a/python_apps/pypo/media/update/silananalyzer.py +++ b/python_apps/pypo/media/update/silananalyzer.py @@ -41,13 +41,17 @@ class SilanAnalyzer(Thread): full_path = f['fp'] # silence detect(set default queue in and out) try: - command = ['nice', '-n', '19', 'silan', '-b', '-f', 'JSON', full_path] - proc = subprocess.Popen(command, stdout=subprocess.PIPE) - out = proc.communicate()[0].strip('\r\n') - info = json.loads(out) data = {} - data['cuein'] = str('{0:f}'.format(info['sound'][0][0])) - data['cueout'] = str('{0:f}'.format(info['sound'][-1][1])) + command = ['nice', '-n', '19', 'silan', '-b', '-f', 'JSON', full_path] + try: + proc = subprocess.Popen(command, stdout=subprocess.PIPE) + out = proc.communicate()[0].strip('\r\n') + info = json.loads(out) + data['cuein'] = str('{0:f}'.format(info['sound'][0][0])) + data['cueout'] = str('{0:f}'.format(info['sound'][-1][1])) + except Exception, e: + self.logger.error(str(command)) + self.logger.error(e) processed_data.append((f['id'], data)) total += 1 if total % 5 == 0: From 7237d48ef6a7accd6f874e844c6cb2989e7f2014 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 26 Mar 2013 15:01:53 -0400 Subject: [PATCH 5/5] fix missing import --- python_apps/media-monitor2/media/monitor/airtime.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python_apps/media-monitor2/media/monitor/airtime.py b/python_apps/media-monitor2/media/monitor/airtime.py index 44d88aa17..d1124449a 100644 --- a/python_apps/media-monitor2/media/monitor/airtime.py +++ b/python_apps/media-monitor2/media/monitor/airtime.py @@ -7,6 +7,7 @@ from os.path import normpath import json import os import copy +import time from media.monitor.exceptions import BadSongFile, InvalidMetadataElement from media.monitor.metadata import Metadata