From 3c53d5c7e61f5bf68ace5dd500e7a52d20f84f1a Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 1 May 2012 10:51:28 -0400 Subject: [PATCH 1/6] CC-3737: ON AIR turns to grey from time to time, while the stream keeps playing -fixed --- airtime_mvc/public/js/airtime/dashboard/playlist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/public/js/airtime/dashboard/playlist.js b/airtime_mvc/public/js/airtime/dashboard/playlist.js index c61254857..a2d3d184e 100644 --- a/airtime_mvc/public/js/airtime/dashboard/playlist.js +++ b/airtime_mvc/public/js/airtime/dashboard/playlist.js @@ -91,7 +91,7 @@ function updateProgressBarValue(){ songPercentDone = 0; currentSong = null; } else { - if (currentSong.media_item_played == true && currentShow.length > 0){ + if (currentShow.length > 0){ scheduled_play_line_to_switch.attr("class", "line-to-switch on"); scheduled_play_div.addClass("ready") scheduled_play_source = true; From 0c337fe4306947893ff7334bac6c2ba0522d7e3c Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 1 May 2012 12:39:56 -0400 Subject: [PATCH 2/6] CC-3747: Metadata popup should also show the filepath of the track -done --- airtime_mvc/application/models/StoredFile.php | 18 ++++++++++++++++-- .../library/get-file-meta-data.ajax.phtml | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index a63cf2703..3270000d2 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -45,7 +45,9 @@ class Application_Model_StoredFile { "mime" => "DbMime", "md5" => "DbMd5", "ftype" => "DbFtype", - "language" => "DbLanguage" + "language" => "DbLanguage", + "filepath" => "DbFilepath", + "directory" => "DbDirectory" ); public function __construct() @@ -223,7 +225,19 @@ class Application_Model_StoredFile { foreach ($c['user'] as $constant => $value) { if (preg_match('/^MDATA_KEY/', $constant)) { if (isset($this->_dbMD[$value])) { - $md[$constant] = $this->getDbColMetadataValue($value); + if ($value == 'filepath') { + $directoryPK = $this->getDbColMetadataValue('directory'); + if ($directoryPK == 1) { + $musicDir = Application_Model_MusicDir::getDirByPK($directoryPK); + $md[$constant] = $musicDir->getDirectory() . $this->getDbColMetadataValue($value); + } + else { + $md[$constant] = $this->getDbColMetadataValue($value); + } + } + else { + $md[$constant] = $this->getDbColMetadataValue($value); + } } } } diff --git a/airtime_mvc/application/views/scripts/library/get-file-meta-data.ajax.phtml b/airtime_mvc/application/views/scripts/library/get-file-meta-data.ajax.phtml index 4e0caf69d..76f62b86a 100644 --- a/airtime_mvc/application/views/scripts/library/get-file-meta-data.ajax.phtml +++ b/airtime_mvc/application/views/scripts/library/get-file-meta-data.ajax.phtml @@ -17,6 +17,7 @@
Isrc Number:md["MDATA_KEY_ISRC"]);?>
Website:md["MDATA_KEY_URL"]);?>
Language:md["MDATA_KEY_LANGUAGE"]);?>
+
File Path:md["MDATA_KEY_FILEPATH"]);?>
From 5b816d1fadc4d91a95809e932bd3591cde611d65 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 1 May 2012 16:42:23 -0400 Subject: [PATCH 3/6] CC-3751: Remove db.php requirement in the upgrade script - fixed --- .../upgrades/airtime-2.1.0/DbUpgrade.php | 2 +- .../airtime-2.1.0/common/UpgradeCommon.php | 53 +++++++------------ 2 files changed, 20 insertions(+), 35 deletions(-) diff --git a/install_minimal/upgrades/airtime-2.1.0/DbUpgrade.php b/install_minimal/upgrades/airtime-2.1.0/DbUpgrade.php index f3b00b8d9..9c08f51e0 100644 --- a/install_minimal/upgrades/airtime-2.1.0/DbUpgrade.php +++ b/install_minimal/upgrades/airtime-2.1.0/DbUpgrade.php @@ -15,7 +15,7 @@ class AirtimeDatabaseUpgrade{ UpgradeCommon::MigrateTablesToVersion(__DIR__, '20120411174904'); $sql = "INSERT INTO cc_pref(\"keystr\", \"valstr\") VALUES('scheduled_play_switch', 'on')"; - UpgradeCommon::nonSelectQueryDb($sql); + UpgradeCommon::queryDb($sql); } /* diff --git a/install_minimal/upgrades/airtime-2.1.0/common/UpgradeCommon.php b/install_minimal/upgrades/airtime-2.1.0/common/UpgradeCommon.php index cc8ee35e0..07e63db99 100644 --- a/install_minimal/upgrades/airtime-2.1.0/common/UpgradeCommon.php +++ b/install_minimal/upgrades/airtime-2.1.0/common/UpgradeCommon.php @@ -1,7 +1,4 @@ getMessage().PHP_EOL; - echo $CC_DBC->getUserInfo().PHP_EOL; + try { + $con = Propel::getConnection(); + } catch (Exception $e) { + echo $e->getMessage().PHP_EOL; echo "Database connection problem.".PHP_EOL; - echo "Check if database '{$CC_CONFIG['dsn']['database']}' exists". - " with corresponding permissions.".PHP_EOL; + echo "Check if database exists with corresponding permissions.".PHP_EOL; if ($p_exitOnError) { exit(1); } - } else { - $CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC); + return false; } + return true; } public static function DbTableExists($p_name) { - global $CC_DBC; - $sql = "SELECT * FROM ".$p_name; - $result = $CC_DBC->GetOne($sql); - if (PEAR::isError($result)) { + $con = Propel::getConnection(); + try { + $sql = "SELECT * FROM ".$p_name." LIMIT 1"; + $con->query($sql); + } catch (PDOException $e){ return false; } return true; @@ -238,27 +234,16 @@ class UpgradeCommon{ fclose($fp); } - public static function selectQueryDb($p_sql){ - global $CC_DBC; + public static function queryDb($p_sql){ + $con = Propel::getConnection(); - $result = $CC_DBC->getRow($p_sql, $fetchmode=DB_FETCHMODE_ASSOC); - if (PEAR::isError($result)) { - echo "Error executing $sql. Exiting."; + try { + $result = $con->exec($p_sql); + } catch (Exception $e) { + echo "Error executing $p_sql. Exiting."; exit(1); } - - return $result; - } - - public static function nonSelectQueryDb($p_sql){ - global $CC_DBC; - $result = $CC_DBC->query($p_sql); - if (PEAR::isError($result)) { - echo "Error executing $sql. Exiting."; - exit(1); - } - return $result; } } From 8a2b9e7221f71a71b98ca86577bb8cd588ac4efe Mon Sep 17 00:00:00 2001 From: James Date: Tue, 1 May 2012 17:05:18 -0400 Subject: [PATCH 4/6] CC-3746: Calendar: Duration of 24hrs show is 00h 00m - fixed --- .../application/controllers/ScheduleController.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 9ce53ca02..9df1ddca2 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -909,7 +909,17 @@ class ScheduleController extends Zend_Controller_Action $duration = $UTCEndDateTime->diff($UTCStartDateTime); - $result = $duration->format('%r%Hh %Im'); + $day = intval($duration->format('%d')); + if($day > 0){ + $hour = intval($duration->format('%h')); + $min = intval($duration->format('%i')); + $hour += $day * 24; + $hour = min($hour, 99); + $sign = $duration->format('%r'); + $result = sprintf('%s%02dh %02dm', $sign, $hour, $min); + }else{ + $result = $duration->format('%r%Hh %Im'); + } }catch (Exception $e){ $result = "Invalid Date"; } From 576836ac18247f61e825f719712abbb2d53fb8c0 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 1 May 2012 17:24:22 -0400 Subject: [PATCH 5/6] CC-3751: Remove db.php requirement in the upgrade script - fixed --- install_minimal/include/airtime-upgrade.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/install_minimal/include/airtime-upgrade.php b/install_minimal/include/airtime-upgrade.php index 6eef3441c..fdbe4c175 100644 --- a/install_minimal/include/airtime-upgrade.php +++ b/install_minimal/include/airtime-upgrade.php @@ -5,8 +5,6 @@ * @copyright 2010 Sourcefabric O.P.S. * @license http://www.gnu.org/licenses/gpl.txt */ - -require_once('DB.php'); require_once(__DIR__.'/airtime-constants.php'); require_once(dirname(__FILE__).'/AirtimeIni.php'); require_once(dirname(__FILE__).'/AirtimeInstall.php'); From 9e4c311cf28580c37eb459ed86080d4d4cff3b58 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 1 May 2012 17:35:36 -0400 Subject: [PATCH 6/6] CC-3751: Remove db.php requirement in the upgrade script - added require_once of Propel --- install_minimal/upgrades/airtime-2.1.0/airtime-upgrade.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_minimal/upgrades/airtime-2.1.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-2.1.0/airtime-upgrade.php index da60de58f..6ed58eb87 100644 --- a/install_minimal/upgrades/airtime-2.1.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-2.1.0/airtime-upgrade.php @@ -23,6 +23,9 @@ function get_conf_location(){ $conf_path = get_conf_location(); require_once $conf_path; +set_include_path(__DIR__.'/../../../airtime_mvc/library' . PATH_SEPARATOR . get_include_path()); + +require_once 'propel/runtime/lib/Propel.php'; require_once 'common/UpgradeCommon.php'; require_once 'ConfFileUpgrade.php'; require_once 'DbUpgrade.php';