From 0c42685c1b2f149afc2f5281774f28d86b934ceb Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 4 Mar 2013 17:03:35 +0000 Subject: [PATCH 1/7] Added php-apc to Recommends: line in debian/control [#CC-4991] --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 4a8ad6e96..b5ea18954 100644 --- a/debian/control +++ b/debian/control @@ -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. From 58f2ee567cfcb012bfd4ce30e5a79f68a261a2d8 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 4 Mar 2013 13:22:06 -0500 Subject: [PATCH 2/7] CC-4997: don't exit install script with non-zero value if airtime-check-system fails -fixed --- install_minimal/airtime-install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install_minimal/airtime-install b/install_minimal/airtime-install index 279fdce64..0bd704900 100755 --- a/install_minimal/airtime-install +++ b/install_minimal/airtime-install @@ -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 *******************************" From 00d577fd5bc76235b653901f060d4202e9ca611a Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 4 Mar 2013 15:22:09 -0500 Subject: [PATCH 3/7] CC-4985: Ensure files deleted via the UI are deleted from stor directory. -temporary fix. We know rabbitmq received the message, but we don't know if media-monitor actually acted on it. --- airtime_mvc/application/models/RabbitMq.php | 5 +++++ airtime_mvc/application/models/StoredFile.php | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/RabbitMq.php b/airtime_mvc/application/models/RabbitMq.php index af20d473e..371fab0b9 100644 --- a/airtime_mvc/application/models/RabbitMq.php +++ b/airtime_mvc/application/models/RabbitMq.php @@ -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); diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 769f6176e..adb5c4c8a 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -368,7 +368,12 @@ SQL; if (file_exists($filepath) && $type == "stor") { $data = array("filepath" => $filepath, "delete" => 1); - Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data); + try { + Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data); + } catch (Exception $e) { + Logging::error($e->getMessage()); + return; + } } From c747b6ad47643ae528c40fb25fe8077594dadd3c Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 4 Mar 2013 16:00:14 -0500 Subject: [PATCH 4/7] CC-4978: Media Monitor: importing file slowly -disable silan on file import -silan will need to be done manually for now using airtime-silan --- .../media-monitor2/media/metadata/process.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/python_apps/media-monitor2/media/metadata/process.py b/python_apps/media-monitor2/media/metadata/process.py index 9128c0bec..0cbc44a54 100644 --- a/python_apps/media-monitor2/media/metadata/process.py +++ b/python_apps/media-monitor2/media/metadata/process.py @@ -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 From ae61b9f4d31337e0de980d48a6ba71e97b84bcdf Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 4 Mar 2013 16:08:40 -0500 Subject: [PATCH 5/7] do not break if a file fails to be silan-analyzed --- utils/airtime-silan.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/airtime-silan.py b/utils/airtime-silan.py index 08bc04b55..fcaa6e88e 100644 --- a/utils/airtime-silan.py +++ b/utils/airtime-silan.py @@ -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 From d7d1170ee1643ed4a9fc54186596c5011abccb4b Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 4 Mar 2013 18:52:51 -0500 Subject: [PATCH 6/7] CC-5003: Some tracks are being cut off before fully playout out -fixed --- airtime_mvc/application/common/DateHelper.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/common/DateHelper.php b/airtime_mvc/application/common/DateHelper.php index cc02544cd..5d40e9b5f 100644 --- a/airtime_mvc/application/common/DateHelper.php +++ b/airtime_mvc/application/common/DateHelper.php @@ -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){ From 215e5ccb4c013f60aba13a5eeb1a64cbe80112fe Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 5 Mar 2013 16:21:05 -0500 Subject: [PATCH 7/7] CC-5001: remove /etc/monit/conf.d/monit-airtime-rabbitmq-server.cfg on 2.3.1 upgrade -don't even install rabbitmq monit file --- install_minimal/include/airtime-initialize.sh | 1 - python_apps/pypo/install/pypo-copy-files.py | 1 - python_apps/pypo/install/pypo-remove-files.py | 1 - 3 files changed, 3 deletions(-) diff --git a/install_minimal/include/airtime-initialize.sh b/install_minimal/include/airtime-initialize.sh index b83967016..50cf65b9f 100755 --- a/install_minimal/include/airtime-initialize.sh +++ b/install_minimal/include/airtime-initialize.sh @@ -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 diff --git a/python_apps/pypo/install/pypo-copy-files.py b/python_apps/pypo/install/pypo-copy-files.py index fd80e7113..e88b46a64 100644 --- a/python_apps/pypo/install/pypo-copy-files.py +++ b/python_apps/pypo/install/pypo-copy-files.py @@ -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: diff --git a/python_apps/pypo/install/pypo-remove-files.py b/python_apps/pypo/install/pypo-remove-files.py index 6b26d7484..3a20a2dda 100644 --- a/python_apps/pypo/install/pypo-remove-files.py +++ b/python_apps/pypo/install/pypo-remove-files.py @@ -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