Merge branch '2.3.x' into 2.3.x-saas
This commit is contained in:
commit
01cca88c58
|
@ -17,15 +17,12 @@ require_once "Timezone.php";
|
||||||
require_once __DIR__.'/forms/helpers/ValidationTypes.php';
|
require_once __DIR__.'/forms/helpers/ValidationTypes.php';
|
||||||
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
require_once (APPLICATION_PATH."/logging/Logging.php");
|
require_once (APPLICATION_PATH."/logging/Logging.php");
|
||||||
Logging::setLogPath('/var/log/airtime/zendphp.log');
|
Logging::setLogPath('/var/log/airtime/zendphp.log');
|
||||||
date_default_timezone_set(Application_Model_Preference::GetTimezone());
|
date_default_timezone_set(Application_Model_Preference::GetTimezone());
|
||||||
|
|
||||||
Config::setAirtimeVersion();
|
Config::setAirtimeVersion();
|
||||||
$CC_CONFIG = Config::getConfig();
|
|
||||||
require_once __DIR__."/configs/navigation.php";
|
require_once __DIR__."/configs/navigation.php";
|
||||||
|
|
||||||
Zend_Validate::setDefaultNamespaces("Zend");
|
Zend_Validate::setDefaultNamespaces("Zend");
|
||||||
|
|
|
@ -7,6 +7,7 @@ from os.path import normpath
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import copy
|
import copy
|
||||||
|
import time
|
||||||
|
|
||||||
from media.monitor.exceptions import BadSongFile, InvalidMetadataElement
|
from media.monitor.exceptions import BadSongFile, InvalidMetadataElement
|
||||||
from media.monitor.metadata import Metadata
|
from media.monitor.metadata import Metadata
|
||||||
|
|
|
@ -12,8 +12,6 @@ ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
export PYTHONPATH=${api_client_path}
|
export PYTHONPATH=${api_client_path}
|
||||||
|
|
||||||
rm -f /etc/airtime/liquidsoap.cfg
|
|
||||||
|
|
||||||
cd /usr/lib/airtime/pypo/bin/liquidsoap_scripts
|
cd /usr/lib/airtime/pypo/bin/liquidsoap_scripts
|
||||||
python generate_liquidsoap_cfg.py
|
python generate_liquidsoap_cfg.py
|
||||||
|
|
||||||
|
|
|
@ -35,12 +35,14 @@ stop () {
|
||||||
start_no_monit() {
|
start_no_monit() {
|
||||||
chown pypo:pypo /var/log/airtime/pypo
|
chown pypo:pypo /var/log/airtime/pypo
|
||||||
chown pypo:pypo /var/log/airtime/pypo-liquidsoap
|
chown pypo:pypo /var/log/airtime/pypo-liquidsoap
|
||||||
|
chown pypo:pypo /etc/airtime/liquidsoap.cfg
|
||||||
|
|
||||||
touch /var/run/airtime-liquidsoap.pid
|
rm -f $PIDFILE
|
||||||
chown pypo:pypo /var/run/airtime-liquidsoap.pid
|
touch $PIDFILE
|
||||||
|
chown pypo:pypo $PIDFILE
|
||||||
|
|
||||||
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
|
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')
|
'status')
|
||||||
if [ -f "/var/run/airtime-liquidsoap.pid" ]; then
|
if [ -f "$PIDFILE" ]; then
|
||||||
pid=`cat /var/run/airtime-liquidsoap.pid`
|
pid=`cat $PIDFILE`
|
||||||
if [ -d "/proc/$pid" ]; then
|
if [ -d "/proc/$pid" ]; then
|
||||||
echo "Liquidsoap is running"
|
echo "Liquidsoap is running"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -41,13 +41,17 @@ class SilanAnalyzer(Thread):
|
||||||
full_path = f['fp']
|
full_path = f['fp']
|
||||||
# silence detect(set default queue in and out)
|
# silence detect(set default queue in and out)
|
||||||
try:
|
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 = {}
|
||||||
data['cuein'] = str('{0:f}'.format(info['sound'][0][0]))
|
command = ['nice', '-n', '19', 'silan', '-b', '-f', 'JSON', full_path]
|
||||||
data['cueout'] = str('{0:f}'.format(info['sound'][-1][1]))
|
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))
|
processed_data.append((f['id'], data))
|
||||||
total += 1
|
total += 1
|
||||||
if total % 5 == 0:
|
if total % 5 == 0:
|
||||||
|
|
Loading…
Reference in New Issue