Merge branch '2.3.x' into 2.3.x-saas
This commit is contained in:
commit
1c80701488
10 changed files with 27 additions and 24 deletions
|
@ -229,7 +229,7 @@ class Application_Common_DateHelper
|
|||
public static function calculateLengthInSeconds($p_time){
|
||||
|
||||
if (2 !== substr_count($p_time, ":")){
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (1 === substr_count($p_time, ".")){
|
||||
|
@ -241,12 +241,8 @@ class Application_Common_DateHelper
|
|||
|
||||
list($hours, $minutes, $seconds) = explode(":", $hhmmss);
|
||||
|
||||
// keep ms in 3 digits
|
||||
$ms = substr($ms, 0, 3);
|
||||
|
||||
$totalSeconds = $hours*3600 + $minutes*60 + $seconds + $ms/1000;
|
||||
|
||||
return $totalSeconds;
|
||||
$totalSeconds = ($hours*3600 + $minutes*60 + $seconds).".$ms";
|
||||
return round($totalSeconds, 3);
|
||||
}
|
||||
|
||||
public static function ConvertToUtcDateTime($p_dateString, $timezone=null){
|
||||
|
|
|
@ -22,6 +22,11 @@ class Application_Model_RabbitMq
|
|||
$CC_CONFIG["rabbitmq"]["user"],
|
||||
$CC_CONFIG["rabbitmq"]["password"],
|
||||
$CC_CONFIG["rabbitmq"]["vhost"]);
|
||||
|
||||
if (!isset($conn)) {
|
||||
throw new Exception("Cannot connect to RabbitMQ server");
|
||||
}
|
||||
|
||||
$channel = $conn->channel();
|
||||
$channel->access_request($CC_CONFIG["rabbitmq"]["vhost"], false, false,
|
||||
true, true);
|
||||
|
|
|
@ -368,7 +368,12 @@ SQL;
|
|||
|
||||
if (file_exists($filepath) && $type == "stor") {
|
||||
$data = array("filepath" => $filepath, "delete" => 1);
|
||||
try {
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
||||
} catch (Exception $e) {
|
||||
Logging::error($e->getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
2
debian/control
vendored
2
debian/control
vendored
|
@ -49,7 +49,7 @@ Depends: apache2,
|
|||
vorbis-tools,
|
||||
zendframework | libzend-framework-php,
|
||||
${misc:Depends}
|
||||
Recommends: icecast2
|
||||
Recommends: icecast2, php-apc
|
||||
Suggests: airtime-audio-samples,
|
||||
alsa-utils
|
||||
Description: open radio software for scheduling and remote station management.
|
||||
|
|
|
@ -217,7 +217,9 @@ if [ "$python_service" -eq "0" ]; then
|
|||
echo -e "\n*** Verifying your system environment, running airtime-check-system ***"
|
||||
sleep 15
|
||||
|
||||
set +e
|
||||
airtime-check-system --no-color
|
||||
set -e
|
||||
fi
|
||||
|
||||
echo -e "\n******************************* Install Complete *******************************"
|
||||
|
|
|
@ -45,7 +45,6 @@ chmod 600 /etc/monit/conf.d/monit-airtime-liquidsoap.cfg
|
|||
chmod 600 /etc/monit/conf.d/monit-airtime-media-monitor.cfg
|
||||
chmod 600 /etc/monit/conf.d/monit-airtime-playout.cfg
|
||||
chmod 600 /etc/monit/conf.d/monit-airtime-liquidsoap.cfg
|
||||
chmod 600 /etc/monit/conf.d/monit-airtime-rabbitmq-server.cfg
|
||||
|
||||
# Start monit if it is not running, or restart if it is.
|
||||
# Need to ensure monit is running before Airtime daemons are run. This is
|
||||
|
|
|
@ -171,17 +171,16 @@ def normalize_mutagen(path):
|
|||
md['path'] = normpath(path)
|
||||
|
||||
# silence detect(set default cue in and out)
|
||||
try:
|
||||
command = ['silan', "-b", '-f', 'JSON', md['path']]
|
||||
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||
out = proc.communicate()[0].strip('\r\n')
|
||||
#try:
|
||||
#command = ['silan', '-b', '-f', 'JSON', md['path']]
|
||||
#proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||
#out = proc.communicate()[0].strip('\r\n')
|
||||
|
||||
info = json.loads(out)
|
||||
md['cuein'] = info['sound'][0][0]
|
||||
md['cueout'] = info['sound'][0][1]
|
||||
except Exception:
|
||||
logger = logging.getLogger()
|
||||
logger.info('silan is missing')
|
||||
#info = json.loads(out)
|
||||
#md['cuein'] = info['sound'][0][0]
|
||||
#md['cueout'] = info['sound'][0][1]
|
||||
#except Exception:
|
||||
#self.logger.debug('silan is missing')
|
||||
|
||||
if 'title' not in md: md['title'] = u''
|
||||
return md
|
||||
|
|
|
@ -88,7 +88,6 @@ try:
|
|||
#copy monit files
|
||||
shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
subprocess.call('sed -i "s/\$admin_pass/%s/g" /etc/monit/conf.d/monit-airtime-generic.cfg' % get_rand_string(), shell=True)
|
||||
shutil.copy('%s/../../monit/monit-airtime-rabbitmq-server.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
|
||||
monit_version = get_monit_version()
|
||||
if version_compare(monit_version, "5.3.0") >= 0:
|
||||
|
|
|
@ -49,7 +49,6 @@ try:
|
|||
remove_file("/etc/monit/conf.d/monit-airtime-playout.cfg")
|
||||
remove_file("/etc/monit/conf.d/monit-airtime-liquidsoap.cfg")
|
||||
remove_file("/etc/monit/conf.d/monit-airtime-generic.cfg")
|
||||
remove_file("/etc/monit/conf.d/monit-airtime-rabbitmq-server.cfg")
|
||||
|
||||
except Exception, e:
|
||||
print e
|
||||
|
|
|
@ -50,7 +50,7 @@ try:
|
|||
full_path = f['fp']
|
||||
# silence detect(set default queue in and out)
|
||||
try:
|
||||
command = ['silan', '-f', 'JSON', full_path]
|
||||
command = ['silan', '-b' '-f', 'JSON', full_path]
|
||||
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||
out = proc.communicate()[0].strip('\r\n')
|
||||
info = json.loads(out)
|
||||
|
@ -64,7 +64,6 @@ try:
|
|||
except Exception, e:
|
||||
print e
|
||||
print traceback.format_exc()
|
||||
break
|
||||
print "Processed: %d songs" % total
|
||||
subtotal += total
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue