Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
James 2011-11-15 16:10:58 -05:00
commit 3374e09242
36 changed files with 618 additions and 321 deletions

View File

@ -1,6 +1,10 @@
=======
CREDITS
=======
Version 1.9.5
-------------
Same as previous version.
Version 1.9.4
-------------
Same as previous version.

View File

@ -68,7 +68,9 @@ class ScheduleController extends Zend_Controller_Action
public function eventFeedAction()
{
$start = new DateTime($this->_getParam('start', null));
$start->setTimezone(new DateTimeZone("UTC"));
$end = new DateTime($this->_getParam('end', null));
$end->setTimezone(new DateTimeZone("UTC"));
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
@ -113,7 +115,7 @@ class ScheduleController extends Zend_Controller_Action
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
try{
$show = new Application_Model_ShowInstance($showInstanceId);
}catch(Exception $e){
@ -123,9 +125,10 @@ class ScheduleController extends Zend_Controller_Action
$error = $show->resizeShow($deltaDay, $deltaMin);
}
if(isset($error))
if (isset($error)) {
$this->view->error = $error;
}
}
public function deleteShowAction()
{
@ -410,7 +413,9 @@ class ScheduleController extends Zend_Controller_Action
$originalShowName = $originalShow->getName();
$originalShowStart = $originalShow->getShowInstanceStart();
$timestamp = strtotime($originalShowStart);
//convert from UTC to user's timezone for display.
$originalDateTime = new DateTime($originalShowStart, new DateTimeZone("UTC"));
$timestamp = strtotime(Application_Model_DateHelper::ConvertToLocalDateTimeString($originalDateTime->format("Y-m-d H:i:s")));
$this->view->additionalShowInfo =
"Rebroadcast of show \"$originalShowName\" from "
.date("l, F jS", $timestamp)." at ".date("G:i", $timestamp);
@ -465,11 +470,11 @@ class ScheduleController extends Zend_Controller_Action
'add_show_genre' => $show->getGenre(),
'add_show_description' => $show->getDescription()));
$startsDateTime = new DateTime($showInstance->getShowInstanceStart(), new DateTimeZone("UTC"));
$endsDateTime = new DateTime($showInstance->getShowInstanceEnd(), new DateTimeZone("UTC"));
$startsDateTime = new DateTime($show->getStartDate()." ".$show->getStartTime(), new DateTimeZone(date_default_timezone_get()));
$endsDateTime = new DateTime($show->getEndDate()." ".$show->getEndTime(), new DateTimeZone(date_default_timezone_get()));
$startsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
$endsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
//$startsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
//$endsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
$formWhen->populate(array('add_show_start_date' => $startsDateTime->format("Y-m-d"),
'add_show_start_time' => $startsDateTime->format("H:i"),

View File

@ -224,8 +224,13 @@ class Application_Model_DateHelper
return $totalSeconds;
}
public static function ConvertToUtcDateTime($p_dateString, $timezone){
public static function ConvertToUtcDateTime($p_dateString, $timezone=null){
if (isset($timezone)) {
$dateTime = new DateTime($p_dateString, new DateTimeZone($timezone));
}
else {
$dateTime = new DateTime($p_dateString, new DateTimeZone(date_default_timezone_get()));
}
$dateTime->setTimezone(new DateTimeZone("UTC"));
return $dateTime;

View File

@ -281,7 +281,6 @@ class Application_Model_MusicDir {
}
public static function removeWatchedDir($p_dir){
$real_path = realpath($p_dir)."/";
if($real_path != "/"){
$p_dir = $real_path;

View File

@ -522,11 +522,10 @@ class Application_Model_Preference
public static function SetLatestVersion($version){
$pattern = "/^[0-9]+\.[0-9]+\.[0-9]+/";
if(!preg_match($pattern, $version)) {
$version = self::GetAirtimeVersion();
}
if(preg_match($pattern, $version)) {
self::SetValue("latest_version", $version);
}
}
public static function SetUploadToSoundcloudOption($upload) {
self::SetValue("soundcloud_upload_option", $upload);

View File

@ -1030,7 +1030,9 @@ class Application_Model_Show {
$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id={$show_id}";
$rebroadcasts = $CC_DBC->GetAll($sql);
self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $utcStartDateTime, $duration);
Logging::log('$start time of non repeating record '.$start);
self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone);
}
}
@ -1042,9 +1044,9 @@ class Application_Model_Show {
* @param array $p_showRow
* A row from cc_show_days table
* @param DateTime $p_dateTime
* DateTime object in UTC time.
* DateTime object in UTC time. "shows_populated_until" date YY-mm-dd in cc_pref
* @param string $p_interval
* Period of time between repeating shows
* Period of time between repeating shows (in php DateInterval notation 'P7D')
*/
private static function populateRepeatingShow($p_showRow, $p_dateTime, $p_interval)
{
@ -1060,6 +1062,8 @@ class Application_Model_Show {
$record = $p_showRow["record"];
$timezone = $p_showRow["timezone"];
$date = new Application_Model_DateHelper();
$currentUtcTimestamp = $date->getUtcTimestamp();
if(isset($next_pop_date)) {
$start = $next_pop_date." ".$start_time;
@ -1068,17 +1072,16 @@ class Application_Model_Show {
}
$utcStartDateTime = Application_Model_DateHelper::ConvertToUtcDateTime($start, $timezone);
//convert $last_show into a UTC DateTime object, or null if there is no last show.
$utcLastShowDateTime = $last_show ? Application_Model_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null;
$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id={$show_id}";
$rebroadcasts = $CC_DBC->GetAll($sql);
$show = new Application_Model_Show($show_id);
$date = new Application_Model_DateHelper();
$currentUtcTimestamp = $date->getUtcTimestamp();
while($utcStartDateTime->getTimestamp()
<= $p_dateTime->getTimestamp() &&
($utcStartDateTime->getTimestamp() < strtotime($last_show) || is_null($last_show))) {
while($utcStartDateTime->getTimestamp() <= $p_dateTime->getTimestamp()
&& (is_null($utcLastShowDateTime) || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())){
$utcStart = $utcStartDateTime->format("Y-m-d H:i:s");
$sql = "SELECT timestamp '{$utcStart}' + interval '{$duration}'";
@ -1113,7 +1116,7 @@ class Application_Model_Show {
$showInstance->correctScheduleStartTimes();
}
self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $utcStartDateTime, $duration);
self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone);
$dt = new DateTime($start, new DateTimeZone($timezone));
$dt->add(new DateInterval($p_interval));
@ -1127,23 +1130,49 @@ class Application_Model_Show {
Application_Model_Show::setNextPop($start, $show_id, $day);
}
private static function createRebroadcastInstances($p_rebroadcasts, $p_currentUtcTimestamp, $p_showId, $p_showInstanceId, $p_utcStartDateTime, $p_duration){
/* Create rebroadcast instances for a created show marked for recording
*
* @param $p_rebroadcasts rows gotten from the db table cc_show_rebroadcasts, tells airtime when to schedule the rebroadcasts.
* @param $p_currentUtcTimestamp a timestring in format "Y-m-d H:i:s", current UTC time.
* @param $p_showId int of the show it belongs to (from cc_show)
* @param $p_showInstanceId the instance id of the created recorded show instance
* (from cc_show_instances), used to associate rebroadcasts to this show.
* @param $p_startTime a timestring in format "Y-m-d H:i:s" in the timezone, not UTC of the rebroadcasts' parent recorded show.
* @param $p_duration duration of the show in format 1:0
* @param $p_timezone string of user's timezone "Europe/Prague"
*
*/
private static function createRebroadcastInstances($p_rebroadcasts, $p_currentUtcTimestamp, $p_showId, $p_showInstanceId, $p_startTime, $p_duration, $p_timezone=null){
global $CC_DBC;
foreach($p_rebroadcasts as $rebroadcast) {
$timeinfo = $p_utcStartDateTime->format("Y-m-d H:i:s");
Logging::log('Count of rebroadcasts '. count($p_rebroadcasts));
$sql = "SELECT timestamp '{$timeinfo}' + interval '{$rebroadcast["day_offset"]}' + interval '{$rebroadcast["start_time"]}'";
foreach($p_rebroadcasts as $rebroadcast) {
//use only the date part of the show start time stamp for the offsets to work properly.
$sql = "SELECT date '{$p_startTime}' + interval '{$rebroadcast["day_offset"]}' + interval '{$rebroadcast["start_time"]}'";
$rebroadcast_start_time = $CC_DBC->GetOne($sql);
Logging::log('rebroadcast start '.$rebroadcast_start_time);
$sql = "SELECT timestamp '{$rebroadcast_start_time}' + interval '{$p_duration}'";
$rebroadcast_end_time = $CC_DBC->GetOne($sql);
Logging::log('rebroadcast end '.$rebroadcast_end_time);
//convert to UTC, after we have used the defined offsets to calculate rebroadcasts.
$utc_rebroadcast_start_time = Application_Model_DateHelper::ConvertToUtcDateTime($rebroadcast_start_time, $p_timezone);
$utc_rebroadcast_end_time = Application_Model_DateHelper::ConvertToUtcDateTime($rebroadcast_end_time, $p_timezone);
Logging::log('UTC rebroadcast start '.$utc_rebroadcast_start_time->format("Y-m-d H:i:s"));
Logging::log('UTC rebroadcast end '.$utc_rebroadcast_end_time->format("Y-m-d H:i:s"));
Logging::log('Current UTC timestamp '.$p_currentUtcTimestamp);
if ($utc_rebroadcast_start_time->format("Y-m-d H:i:s") > $p_currentUtcTimestamp){
Logging::log('Creating rebroadcast show starting at UTC '.$utc_rebroadcast_start_time->format("Y-m-d H:i:s"));
if ($rebroadcast_start_time > $p_currentUtcTimestamp){
$newRebroadcastInstance = new CcShowInstances();
$newRebroadcastInstance->setDbShowId($p_showId);
$newRebroadcastInstance->setDbStarts($rebroadcast_start_time);
$newRebroadcastInstance->setDbEnds($rebroadcast_end_time);
$newRebroadcastInstance->setDbStarts($utc_rebroadcast_start_time->format("Y-m-d H:i:s"));
$newRebroadcastInstance->setDbEnds($utc_rebroadcast_end_time->format("Y-m-d H:i:s"));
$newRebroadcastInstance->setDbRecord(0);
$newRebroadcastInstance->setDbRebroadcast(1);
$newRebroadcastInstance->setDbOriginalShow($p_showInstanceId);
@ -1167,6 +1196,7 @@ class Application_Model_Show {
{
global $CC_DBC;
//UTC DateTime object
$showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil();
//if application is requesting shows past our previous populated until date, generate shows up until this point.
@ -1176,7 +1206,7 @@ class Application_Model_Show {
}
$sql = "SELECT starts, ends, record, rebroadcast, instance_id, show_id, name, description,
color, background_color, file_id, cc_show_instances.id AS instance_id
color, background_color, file_id, deleted_instance, cc_show_instances.id AS instance_id
FROM cc_show_instances
LEFT JOIN cc_show ON cc_show.id = cc_show_instances.show_id";
@ -1273,8 +1303,11 @@ class Application_Model_Show {
$shows = Application_Model_Show::getShows($start, $end);
$today_timestamp = date("Y-m-d H:i:s");
$today_timestamp = Application_Model_DateHelper::ConvertToUtcDateTime(date("Y-m-d H:i:s"))->format("Y-m-d H:i:s");
foreach ($shows as $show) {
if ($show["deleted_instance"] != "t"){
$options = array();
//only bother calculating percent for week or day view.
@ -1286,11 +1319,11 @@ class Application_Model_Show {
if ($editable && (strtotime($today_timestamp) < strtotime($show["starts"]))) {
$options["editable"] = true;
$events[] = Application_Model_Show::makeFullCalendarEvent($show, $options);
}
else {
} else {
$events[] = Application_Model_Show::makeFullCalendarEvent($show, $options);
}
}
}
return $events;
}
@ -1317,6 +1350,7 @@ class Application_Model_Show {
$event["description"] = $show["description"];
$event["showId"] = $show["show_id"];
$event["record"] = intval($show["record"]);
$event["deleted_instance"] = $show["deleted_instance"];
$event["rebroadcast"] = intval($show["rebroadcast"]);
// get soundcloud_id

View File

@ -137,6 +137,11 @@ class Application_Model_ShowInstance {
$this->_showInstance->updateDbTimeFilled($con);
}
public function isDeleted()
{
$this->_showInstance->getDbDeletedInstance();
}
public function correctScheduleStartTimes(){
global $CC_DBC;
@ -246,7 +251,7 @@ class Application_Model_ShowInstance {
$mins = abs($deltaMin%60);
$today_timestamp = date("Y-m-d H:i:s");
$today_timestamp = Application_Model_DateHelper::ConvertToUtcDateTime(date("Y-m-d H:i:s"))->format("Y-m-d H:i:s");
$starts = $this->getShowInstanceStart();
$ends = $this->getShowInstanceEnd();
@ -259,8 +264,11 @@ class Application_Model_ShowInstance {
//only need to check overlap if show increased in size.
if(strtotime($new_ends) > strtotime($ends)) {
//TODO --martin
$overlap = Application_Model_Show::getShows($ends, $new_ends);
$utcStartDateTime = new DateTime($ends, new DateTimeZone("UTC"));
$utcEndDateTime = new DateTime($new_ends, new DateTimeZone("UTC"));
$overlap = Application_Model_Show::getShows($utcStartDateTime, $utcEndDateTime);
if(count($overlap) > 0) {
return "Should not overlap shows";
@ -392,16 +400,23 @@ class Application_Model_ShowInstance {
CcShowInstancesQuery::create()
->findPK($this->_instanceId)
->delete();
->setDbDeletedInstance(true)
->save();
// check if we can safely delete the show
$showInstancesRow = CcShowInstancesQuery::create()
->filterByDbShowId($showId)
->filterByDbDeletedInstance(false)
->findOne();
/* If we didn't find any instances of the show that haven't
* been deleted, then just erase everything related to that show.
* We can just delete, the show and the foreign key-constraint should
* take care of deleting all of its instances. */
if(is_null($showInstancesRow)){
$sql = "DELETE FROM cc_show WHERE id = '$showId'";
$CC_DBC->query($sql);
CcShowQuery::create()
->filterByDbId($showId)
->delete();
}
Application_Model_RabbitMq::PushSchedule();

View File

@ -96,24 +96,25 @@ class Application_Model_Systemstatus
}
public static function GetPlatformInfo(){
$data = array("release"=>"UNKNOWN",
"machine"=>"UNKNOWN",
"memory"=>"UNKNOWN",
"swap"=>"UNKNOWN");
$keys = array("release", "machine", "memory", "swap");
foreach($keys as $key) {
$data[$key] = "UNKNOWN";
}
$docRoot = self::GetMonitStatus("localhost");
if (!is_null($docRoot)){
foreach ($docRoot->getElementsByTagName("platform") AS $item)
{
$data["release"] = $item->getElementsByTagName("release")->item(0)->nodeValue;
$data["machine"] = $item->getElementsByTagName("machine")->item(0)->nodeValue;
$data["memory"] = $item->getElementsByTagName("memory")->item(0)->nodeValue;
$data["swap"] = $item->getElementsByTagName("swap")->item(0)->nodeValue;
foreach($keys as $key) {
$keyElement = $item->getElementsByTagName($key);
if($keyElement->length > 0) {
$data[$key] = $keyElement->item(0)->nodeValue;
}
}
}
}
return $data;
}
public static function GetPypoStatus(){

View File

@ -47,6 +47,7 @@ class CcShowInstancesTableMap extends TableMap {
$this->addForeignKey('INSTANCE_ID', 'DbOriginalShow', 'INTEGER', 'cc_show_instances', 'ID', false, null, null);
$this->addForeignKey('FILE_ID', 'DbRecordedFile', 'INTEGER', 'cc_files', 'ID', false, null, null);
$this->addColumn('TIME_FILLED', 'DbTimeFilled', 'TIME', false, null, null);
$this->addColumn('DELETED_INSTANCE', 'DbDeletedInstance', 'BOOLEAN', true, null, false);
// validators
} // initialize()

View File

@ -80,6 +80,13 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
*/
protected $time_filled;
/**
* The value for the deleted_instance field.
* Note: this column has a database default value of: false
* @var boolean
*/
protected $deleted_instance;
/**
* @var CcShow
*/
@ -129,6 +136,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
{
$this->record = 0;
$this->rebroadcast = 0;
$this->deleted_instance = false;
}
/**
@ -300,6 +308,16 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
}
}
/**
* Get the [deleted_instance] column value.
*
* @return boolean
*/
public function getDbDeletedInstance()
{
return $this->deleted_instance;
}
/**
* Set the value of [id] column.
*
@ -579,6 +597,26 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
return $this;
} // setDbTimeFilled()
/**
* Set the value of [deleted_instance] column.
*
* @param boolean $v new value
* @return CcShowInstances The current object (for fluent API support)
*/
public function setDbDeletedInstance($v)
{
if ($v !== null) {
$v = (boolean) $v;
}
if ($this->deleted_instance !== $v || $this->isNew()) {
$this->deleted_instance = $v;
$this->modifiedColumns[] = CcShowInstancesPeer::DELETED_INSTANCE;
}
return $this;
} // setDbDeletedInstance()
/**
* Indicates whether the columns in this object are only set to default values.
*
@ -597,6 +635,10 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
return false;
}
if ($this->deleted_instance !== false) {
return false;
}
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
@ -628,6 +670,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->instance_id = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
$this->file_id = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null;
$this->time_filled = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
$this->deleted_instance = ($row[$startcol + 9] !== null) ? (boolean) $row[$startcol + 9] : null;
$this->resetModified();
$this->setNew(false);
@ -636,7 +679,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->ensureConsistency();
}
return $startcol + 9; // 9 = CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 10; // 10 = CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcShowInstances object", $e);
@ -1060,6 +1103,9 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
case 8:
return $this->getDbTimeFilled();
break;
case 9:
return $this->getDbDeletedInstance();
break;
default:
return null;
break;
@ -1093,6 +1139,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$keys[6] => $this->getDbOriginalShow(),
$keys[7] => $this->getDbRecordedFile(),
$keys[8] => $this->getDbTimeFilled(),
$keys[9] => $this->getDbDeletedInstance(),
);
if ($includeForeignObjects) {
if (null !== $this->aCcShow) {
@ -1162,6 +1209,9 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
case 8:
$this->setDbTimeFilled($value);
break;
case 9:
$this->setDbDeletedInstance($value);
break;
} // switch()
}
@ -1195,6 +1245,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
if (array_key_exists($keys[6], $arr)) $this->setDbOriginalShow($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setDbRecordedFile($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setDbTimeFilled($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setDbDeletedInstance($arr[$keys[9]]);
}
/**
@ -1215,6 +1266,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
if ($this->isColumnModified(CcShowInstancesPeer::INSTANCE_ID)) $criteria->add(CcShowInstancesPeer::INSTANCE_ID, $this->instance_id);
if ($this->isColumnModified(CcShowInstancesPeer::FILE_ID)) $criteria->add(CcShowInstancesPeer::FILE_ID, $this->file_id);
if ($this->isColumnModified(CcShowInstancesPeer::TIME_FILLED)) $criteria->add(CcShowInstancesPeer::TIME_FILLED, $this->time_filled);
if ($this->isColumnModified(CcShowInstancesPeer::DELETED_INSTANCE)) $criteria->add(CcShowInstancesPeer::DELETED_INSTANCE, $this->deleted_instance);
return $criteria;
}
@ -1284,6 +1336,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$copyObj->setDbOriginalShow($this->instance_id);
$copyObj->setDbRecordedFile($this->file_id);
$copyObj->setDbTimeFilled($this->time_filled);
$copyObj->setDbDeletedInstance($this->deleted_instance);
if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of
@ -1801,6 +1854,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->instance_id = null;
$this->file_id = null;
$this->time_filled = null;
$this->deleted_instance = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->clearAllReferences();

View File

@ -26,7 +26,7 @@ abstract class BaseCcShowInstancesPeer {
const TM_CLASS = 'CcShowInstancesTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 9;
const NUM_COLUMNS = 10;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@ -58,6 +58,9 @@ abstract class BaseCcShowInstancesPeer {
/** the column name for the TIME_FILLED field */
const TIME_FILLED = 'cc_show_instances.TIME_FILLED';
/** the column name for the DELETED_INSTANCE field */
const DELETED_INSTANCE = 'cc_show_instances.DELETED_INSTANCE';
/**
* An identiy map to hold any loaded instances of CcShowInstances objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
@ -74,12 +77,12 @@ abstract class BaseCcShowInstancesPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbShowId', 'DbRecord', 'DbRebroadcast', 'DbOriginalShow', 'DbRecordedFile', 'DbTimeFilled', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbShowId', 'dbRecord', 'dbRebroadcast', 'dbOriginalShow', 'dbRecordedFile', 'dbTimeFilled', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::SHOW_ID, self::RECORD, self::REBROADCAST, self::INSTANCE_ID, self::FILE_ID, self::TIME_FILLED, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'SHOW_ID', 'RECORD', 'REBROADCAST', 'INSTANCE_ID', 'FILE_ID', 'TIME_FILLED', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'show_id', 'record', 'rebroadcast', 'instance_id', 'file_id', 'time_filled', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbShowId', 'DbRecord', 'DbRebroadcast', 'DbOriginalShow', 'DbRecordedFile', 'DbTimeFilled', 'DbDeletedInstance', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbShowId', 'dbRecord', 'dbRebroadcast', 'dbOriginalShow', 'dbRecordedFile', 'dbTimeFilled', 'dbDeletedInstance', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::SHOW_ID, self::RECORD, self::REBROADCAST, self::INSTANCE_ID, self::FILE_ID, self::TIME_FILLED, self::DELETED_INSTANCE, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'SHOW_ID', 'RECORD', 'REBROADCAST', 'INSTANCE_ID', 'FILE_ID', 'TIME_FILLED', 'DELETED_INSTANCE', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'show_id', 'record', 'rebroadcast', 'instance_id', 'file_id', 'time_filled', 'deleted_instance', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
@ -89,12 +92,12 @@ abstract class BaseCcShowInstancesPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbShowId' => 3, 'DbRecord' => 4, 'DbRebroadcast' => 5, 'DbOriginalShow' => 6, 'DbRecordedFile' => 7, 'DbTimeFilled' => 8, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbShowId' => 3, 'dbRecord' => 4, 'dbRebroadcast' => 5, 'dbOriginalShow' => 6, 'dbRecordedFile' => 7, 'dbTimeFilled' => 8, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::SHOW_ID => 3, self::RECORD => 4, self::REBROADCAST => 5, self::INSTANCE_ID => 6, self::FILE_ID => 7, self::TIME_FILLED => 8, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'SHOW_ID' => 3, 'RECORD' => 4, 'REBROADCAST' => 5, 'INSTANCE_ID' => 6, 'FILE_ID' => 7, 'TIME_FILLED' => 8, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'show_id' => 3, 'record' => 4, 'rebroadcast' => 5, 'instance_id' => 6, 'file_id' => 7, 'time_filled' => 8, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbShowId' => 3, 'DbRecord' => 4, 'DbRebroadcast' => 5, 'DbOriginalShow' => 6, 'DbRecordedFile' => 7, 'DbTimeFilled' => 8, 'DbDeletedInstance' => 9, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbShowId' => 3, 'dbRecord' => 4, 'dbRebroadcast' => 5, 'dbOriginalShow' => 6, 'dbRecordedFile' => 7, 'dbTimeFilled' => 8, 'dbDeletedInstance' => 9, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::SHOW_ID => 3, self::RECORD => 4, self::REBROADCAST => 5, self::INSTANCE_ID => 6, self::FILE_ID => 7, self::TIME_FILLED => 8, self::DELETED_INSTANCE => 9, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'SHOW_ID' => 3, 'RECORD' => 4, 'REBROADCAST' => 5, 'INSTANCE_ID' => 6, 'FILE_ID' => 7, 'TIME_FILLED' => 8, 'DELETED_INSTANCE' => 9, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'show_id' => 3, 'record' => 4, 'rebroadcast' => 5, 'instance_id' => 6, 'file_id' => 7, 'time_filled' => 8, 'deleted_instance' => 9, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
@ -175,6 +178,7 @@ abstract class BaseCcShowInstancesPeer {
$criteria->addSelectColumn(CcShowInstancesPeer::INSTANCE_ID);
$criteria->addSelectColumn(CcShowInstancesPeer::FILE_ID);
$criteria->addSelectColumn(CcShowInstancesPeer::TIME_FILLED);
$criteria->addSelectColumn(CcShowInstancesPeer::DELETED_INSTANCE);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.STARTS');
@ -185,6 +189,7 @@ abstract class BaseCcShowInstancesPeer {
$criteria->addSelectColumn($alias . '.INSTANCE_ID');
$criteria->addSelectColumn($alias . '.FILE_ID');
$criteria->addSelectColumn($alias . '.TIME_FILLED');
$criteria->addSelectColumn($alias . '.DELETED_INSTANCE');
}
}

View File

@ -15,6 +15,7 @@
* @method CcShowInstancesQuery orderByDbOriginalShow($order = Criteria::ASC) Order by the instance_id column
* @method CcShowInstancesQuery orderByDbRecordedFile($order = Criteria::ASC) Order by the file_id column
* @method CcShowInstancesQuery orderByDbTimeFilled($order = Criteria::ASC) Order by the time_filled column
* @method CcShowInstancesQuery orderByDbDeletedInstance($order = Criteria::ASC) Order by the deleted_instance column
*
* @method CcShowInstancesQuery groupByDbId() Group by the id column
* @method CcShowInstancesQuery groupByDbStarts() Group by the starts column
@ -25,6 +26,7 @@
* @method CcShowInstancesQuery groupByDbOriginalShow() Group by the instance_id column
* @method CcShowInstancesQuery groupByDbRecordedFile() Group by the file_id column
* @method CcShowInstancesQuery groupByDbTimeFilled() Group by the time_filled column
* @method CcShowInstancesQuery groupByDbDeletedInstance() Group by the deleted_instance column
*
* @method CcShowInstancesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcShowInstancesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -62,6 +64,7 @@
* @method CcShowInstances findOneByDbOriginalShow(int $instance_id) Return the first CcShowInstances filtered by the instance_id column
* @method CcShowInstances findOneByDbRecordedFile(int $file_id) Return the first CcShowInstances filtered by the file_id column
* @method CcShowInstances findOneByDbTimeFilled(string $time_filled) Return the first CcShowInstances filtered by the time_filled column
* @method CcShowInstances findOneByDbDeletedInstance(boolean $deleted_instance) Return the first CcShowInstances filtered by the deleted_instance column
*
* @method array findByDbId(int $id) Return CcShowInstances objects filtered by the id column
* @method array findByDbStarts(string $starts) Return CcShowInstances objects filtered by the starts column
@ -72,6 +75,7 @@
* @method array findByDbOriginalShow(int $instance_id) Return CcShowInstances objects filtered by the instance_id column
* @method array findByDbRecordedFile(int $file_id) Return CcShowInstances objects filtered by the file_id column
* @method array findByDbTimeFilled(string $time_filled) Return CcShowInstances objects filtered by the time_filled column
* @method array findByDbDeletedInstance(boolean $deleted_instance) Return CcShowInstances objects filtered by the deleted_instance column
*
* @package propel.generator.airtime.om
*/
@ -446,6 +450,23 @@ abstract class BaseCcShowInstancesQuery extends ModelCriteria
return $this->addUsingAlias(CcShowInstancesPeer::TIME_FILLED, $dbTimeFilled, $comparison);
}
/**
* Filter the query on the deleted_instance column
*
* @param boolean|string $dbDeletedInstance The value to use as filter.
* Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcShowInstancesQuery The current query, for fluid interface
*/
public function filterByDbDeletedInstance($dbDeletedInstance = null, $comparison = null)
{
if (is_string($dbDeletedInstance)) {
$deleted_instance = in_array(strtolower($dbDeletedInstance), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
}
return $this->addUsingAlias(CcShowInstancesPeer::DELETED_INSTANCE, $dbDeletedInstance, $comparison);
}
/**
* Filter the query by a related CcShow object
*

View File

@ -26,36 +26,31 @@ class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract{
return "";
}
// Calculate version diff
// Calculate major version diff;
// Example: if current = 1.9.5 and latest = 3.0.0, major diff = 11
// Note: algorithm assumes the number after 1st dot never goes above 9
$diff = (intval($latestMatch[1]) * 10 + intval($latestMatch[2]))
- (intval($curMatch[1]) * 10 + intval($curMatch[2]));
// Pick icon and tooltip msg
$bg = "/css/images/";
$msg = "";
$link = "<a href='http://apt.sourcefabric.org/misc/'>" . $latest . "</a>";
// Pick icon
if(($diff == 0 && $current == $latest) || $diff < 0) {
// current version is up to date
$bg .= "icon_uptodate.png";
$msg = "You are running the latest version";
$class = "uptodate";
} else if($diff <= 2) {
// 2 or less major versions back
$bg .= "icon_update.png";
$msg = "New version available: " . $link;
$class = "update";
} else if($diff == 3) {
// 3 major versions back
$bg .= "icon_update2.png";
$msg = "This version will soon be obsolete.<br/>Please upgrade to " . $link;
$class = "update2";
} else {
// more than 3 major versions back
$bg .= "icon_outdated.png";
$msg = "This version is no longer supported.<br/>Please upgrade to " . $link;
$class = "outdated";
}
$result = "<div id='version_message' style='display:none'>" . $msg . "</div>"
. "<div id='version_current' style='display:none'>" . $current . "</div>"
. "<div id='version_icon' style='background-image: url(" . $bg . ");'></div>";
$result = "<div id='version-diff' style='display:none'>" . $diff . "</div>"
. "<div id='version-current' style='display:none'>" . $current . "</div>"
. "<div id='version-latest' style='display:none'>" . $latest . "</div>"
. "<div id='version-icon' class='" . $class . "'></div>";
return $result;
}
}

View File

@ -149,6 +149,11 @@
<column name="instance_id" phpName="DbOriginalShow" type="INTEGER" required="false"/>
<column name="file_id" phpName="DbRecordedFile" type="INTEGER" required="false"/>
<column name="time_filled" phpName="DbTimeFilled" type="TIME" />
<!-- The purpose of the deleted_instance column is to mark a show instance that was
deleted when it was part of repeating show. This is useful because the way shows work,
instances can be regenerated if we edit the show, which is unwanted behaviour. This column serves
to ensure that we don't regenerate the instance. -->
<column name="deleted_instance" phpName="DbDeletedInstance" type="BOOLEAN" required="true" defaultValue="false" />
<behavior name="aggregate_column">
<parameter name="name" value="time_filled" />
<parameter name="foreign_table" value="cc_schedule" />

View File

@ -196,6 +196,7 @@ CREATE TABLE "cc_show_instances"
"instance_id" INTEGER,
"file_id" INTEGER,
"time_filled" TIME,
"deleted_instance" BOOLEAN default 'f' NOT NULL,
PRIMARY KEY ("id")
);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -58,19 +58,30 @@ select {
}
/* Version Notification Starts*/
#version_icon {
#version-icon {
position:absolute;
right:85px;
right:96px;
top:104px;
height:35px;
width:35px;
z-index:1000;
display:block;
cursor:pointer;
background-repeat:no-repeat;
background-position:center;
}
#version-icon.outdated {
background-image:url(/css/images/icon_outdated.png);
}
#version-icon.update2 {
background-image:url(/css/images/icon_update2.png);
}
#version-icon.update {
background-image:url(/css/images/icon_update.png);
}
#version-icon.uptodate {
background-image:url(/css/images/icon_uptodate.png);
}
#ui-tooltip-version a {
color:#ff5d1a;
@ -2366,6 +2377,9 @@ tfoot tr th {
margin:2px 1px 10px 0px;
width: auto;
}
dd .stream-status {
margin-bottom:1px;
}
.stream-status h3 {
font-size: 12px;
font-weight: bold;
@ -2398,3 +2412,17 @@ tfoot tr th {
.status-error h3 {
color:#DA0101;
}
.status-info {
background:#fff7e0 url(images/stream_status.png) no-repeat 5px -278px;
border-color:#f68826;
}
.status-info h3 {
color:#f1830c;
}
.status-disabled {
background:#c8ccc8 url(images/stream_status.png) no-repeat 5px -429px;
border-color:#7f827f;
}
.status-disabled h3 {
color:#646664;
}

View File

@ -1,24 +1,68 @@
/**
* Get the tooltip message to be displayed,
* which is stored inside a pair of hidden div tags
* Get the tooltip message to be displayed
*/
function getContent() {
return $("#version_message").html();
var diff = getVersionDiff();
var link = getLatestLink();
var msg = "";
if(isUpToDate()) {
msg = "You are running the latest version";
} else if(diff <= 2) {
msg = "New version available: " + link;
} else if(diff == 3) {
msg = "This version will soon be obsolete.<br/>Please upgrade to " + link;
} else {
msg = "This version is no longer supported.<br/>Please upgrade to " + link;
}
return msg;
}
/**
* Get the current version,
* which is stored inside a pair of hidden div tags
* Get major version difference b/w current and latest version, in int
*/
function getVersionDiff() {
return parseInt($("#version-diff").html());
}
/**
* Get the current version
*/
function getCurrentVersion() {
return $("#version_current").html();
return $("#version-current").html();
}
/**
* Get the latest version
*/
function getLatestVersion() {
return $("#version-latest").html();
}
/**
* Returns true if current version is up to date
*/
function isUpToDate() {
var diff = getVersionDiff();
var current = getCurrentVersion();
var latest = getLatestVersion();
var temp = (diff == 0 && current == latest) || diff < 0;
return (diff == 0 && current == latest) || diff < 0;
}
/**
* Returns the download link to latest release in HTML
*/
function getLatestLink() {
return "<a href='http://apt.sourcefabric.org/misc/'>" + getLatestVersion() + "</a>";
}
/**
* Sets up the tooltip for version notification
*/
function setupVersionQtip(){
var qtipElem = $('#version_icon');
var qtipElem = $('#version-icon');
if (qtipElem.length > 0){
qtipElem.qtip({
id: 'version',
@ -26,11 +70,12 @@ function setupVersionQtip(){
text: getContent(),
title: {
text: getCurrentVersion(),
button: true
button: isUpToDate() ? false : true
}
},
show: 'click', /* Show on click */
hide: false, /* Don't hide on mouseout */
hide: {
event: isUpToDate() ? 'mouseleave' : 'unfocus'
},
position: {
my: "top right",
at: "bottom left"
@ -47,7 +92,7 @@ function setupVersionQtip(){
}
$(document).ready(function() {
if($('#version_message').length > 0) {
if($('#version-icon').length > 0) {
setupVersionQtip();
}
});

View File

@ -1,3 +1,11 @@
1.9.5 - Nov 2, 2011
*(CC-2743, CC-2769) Fixed problem where Media-Monitor would try to parse a file's metadata while the OS was still copying it
*(CC-2882) Fixed a bug where a couldn't unregister an old directory name from Airtime after it was renamed.
*(CC-2891) Fixed a bug with parsing Unicode metadata in audio files.
*(CC-2972) Fixed a bug where systems behind a firewall would have Airtime services communicating via its external IP.
*(CC-2975) Issue with older python-virtualenv identified. Airtime installer now requires virtualenv >= 1.4.9
*(CC-3012, CC-3013) Fixed an issue with Media-Monitor crashing when parsing certain audio tracks
1.9.4 - Sept 13, 2011
*Improvements
-DEB packages now available for Ubuntu & Debian

View File

@ -22,18 +22,19 @@ echo "----------------------------------------------------"
echo " 1. Install Packages"
echo "----------------------------------------------------"
apt-get update
# Updated package list
apt-get -y install tar gzip curl apache2 php5-pgsql libapache2-mod-php5 \
php-pear php5-gd postgresql odbc-postgresql python2.6 lame libsoundtouch-ocaml \
libmp3lame-dev libtaglib-ocaml libao-ocaml libmad-ocaml ecasound \
libesd0 icecast2 libportaudio2 libsamplerate0 rabbitmq-server patch \
php-pear php5-gd postgresql odbc-postgresql python2.6 libsoundtouch-ocaml \
libtaglib-ocaml libao-ocaml libmad-ocaml ecasound \
libesd0 libportaudio2 libsamplerate0 rabbitmq-server patch \
php5-curl mpg123 monit python-virtualenv multitail libcamomile-ocaml-data \
libvorbis-ocaml
#possibly remove?
#libvorbis-ocaml-dev
#libcamomile-ocaml-dev
#install packages with --force-yes option (this is useful in the case
#of Debian, where these packages are unauthorized)
apt-get -y --force-yes install libmp3lame-dev lame icecast2
if [ "$?" -ne "0" ]; then
echo ""

View File

@ -11,7 +11,7 @@ class Version20111103141311 extends AbstractMigration
{
// add timezone column to cc_show_days
$cc_subjs = $schema->getTable('cc_show_days');
$cc_subjs->addColumn('timezone', 'string', array('required' => true));
$cc_subjs->addColumn('timezone', 'string', array('required' => true, 'default'=> ''));
}
public function down(Schema $schema)

View File

@ -0,0 +1,20 @@
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
class Version20111114222927 extends AbstractMigration
{
public function up(Schema $schema)
{
$cc_show_instances = $schema->getTable('cc_show_instances');
$cc_show_instances->addColumn('deleted_instance', 'boolean', array('notnull' => true, 'default'=> '0'));
}
public function down(Schema $schema)
{
}
}

View File

@ -15,21 +15,6 @@ if [[ "$DEB" = "Status: install ok installed" ]]; then
exit 1
fi
#Check whether version of virtualenv is <= 1.4.8. If so exit install.
BAD_VERSION="1.4.8"
VERSION=$(virtualenv --version)
NEWEST_VERSION=$(echo -e "$BAD_VERSION\n$VERSION\n'" | sort -t '.' -g | tail -n 1)
echo -n "Ensuring python-virtualenv version > $BAD_VERSION..."
if [[ "$NEWEST_VERSION" = "$BAD_VERSION" ]]; then
URL="http://apt.sourcefabric.org/pool/main/p/python-virtualenv/python-virtualenv_1.4.9-3_all.deb"
echo "Failed!"
echo "You have version $BAD_VERSION or older installed. Please install package at $URL first and then try installing Airtime again."
exit 1
else
echo "Success!"
fi
echo -e "\n******************************** Install Begin *********************************"
# Absolute path to this script, e.g. /home/user/bin/foo.sh

View File

@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/bash
#Check if root user
if [ `whoami` != 'root' ]; then

View File

@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/bash
#-e Causes bash script to exit if any of the installers
#return with a non-zero return value.

View File

@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/bash
#-e Causes bash script to exit if any of the installers
#return with a non-zero return value.

View File

@ -80,11 +80,13 @@ if (strcmp($version, "1.9.3") < 0){
if (strcmp($version, "1.9.4") < 0){
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-1.9.4/airtime-upgrade.php");
}
if (strcmp($version, "1.9.5") < 0){
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-1.9.5/airtime-upgrade.php");
}
if (strcmp($version, "2.0.0") < 0){
system("php ".__DIR__."/../upgrades/airtime-2.0.0/airtime-upgrade.php");
}
//set the new version in the database.
$sql = "DELETE FROM cc_pref WHERE keystr = 'system_version'";
$CC_DBC->query($sql);

View File

@ -0,0 +1,37 @@
<?php
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
class Airtime195Upgrade{
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
const CONF_FILE_AIRTIME = "/etc/airtime/airtime.conf";
const CONF_PYPO_GRP = "pypo";
public static function BackupHtaccess($phpDir){
exec("mkdir -p /tmp");
exec("cp $phpDir/public/.htaccess /tmp");
}
public static function RestoreHtaccess($phpDir){
exec("cp /tmp/.htaccess $phpDir/public/");
exec("rm -f /tmp/.htaccess");
}
public static function InstallAirtimePhpServerCode($phpDir)
{
self::BackupHtaccess($phpDir);
$AIRTIME_SRC = realpath(__DIR__.'/../../../airtime_mvc');
echo "* Installing PHP code to ".$phpDir.PHP_EOL;
exec("rm -rf \"$phpDir\"");
exec("mkdir -p $phpDir");
exec("cp -R ".$AIRTIME_SRC."/* ".$phpDir);
self::RestoreHtaccess($phpDir);
}
}
$values = parse_ini_file(Airtime195Upgrade::CONF_FILE_AIRTIME, true);
$phpDir = $values['general']['airtime_dir'];
Airtime195Upgrade::InstallAirtimePhpServerCode($phpDir);

View File

@ -103,6 +103,7 @@ class AirtimeDatabaseUpgrade{
$showDays = CcShowDaysQuery::create()->find();
foreach ($showDays as $sd){
/*
$dt = new DateTime($sd->getDbFirstShow()." ".$sd->getDbStartTime(), new DateTimeZone(date_default_timezone_get()));
$dt->setTimezone(new DateTimeZone("UTC"));
$sd->setDbFirstShow($dt->format("Y-m-d"));
@ -113,6 +114,11 @@ class AirtimeDatabaseUpgrade{
$sd->setDbLastShow($dt->format("Y-m-d"));
$sd->save();
* */
$sd->setDbTimezone(date_default_timezone_get())->save();
}
}
@ -141,7 +147,7 @@ class AirtimeDatabaseUpgrade{
}
}
UpgradeCommon::MigrateTablesToVersion(__DIR__, '20111103141311');
UpgradeCommon::MigrateTablesToVersion(__DIR__, '20111114222927');
}
private static function SetDefaultStreamSetting()

View File

@ -29,7 +29,7 @@ class MediaMonitorCommon:
# if file doesn't have any extension, info[-2] throws exception
# Hence, checking length of info before we do anything
if(len(info) >= 3):
if(len(info) >= 2):
if(info[-2] in self.supported_file_formats):
return True
else:

View File

@ -4,6 +4,27 @@ SCRIPT=`readlink -f $0`
# Absolute directory this script is in
SCRIPTPATH=`dirname $SCRIPT`
which virtualenv > /dev/null
if [ "$?" -ne "0" ]; then
echo "virtualenv not found!"
echo -e "Please install virtualenv and retry Airtime installation.\n"
exit 1
fi
#Check whether version of virtualenv is <= 1.4.8. If so exit install.
BAD_VERSION="1.4.8"
VERSION=$(virtualenv --version)
NEWEST_VERSION=$(echo -e "$BAD_VERSION\n$VERSION\n'" | sort -t '.' -g | tail -n 1)
echo -n "Ensuring python-virtualenv version > $BAD_VERSION..."
if [[ "$NEWEST_VERSION" = "$BAD_VERSION" ]]; then
URL="http://apt.sourcefabric.org/pool/main/p/python-virtualenv/python-virtualenv_1.4.9-3_all.deb"
echo "Failed!"
echo "You have version $BAD_VERSION or older installed. Please install package at $URL first and then try installing Airtime again."
exit 1
else
echo "Success!"
fi
VIRTUAL_ENV_DIR="/usr/lib/airtime/airtime_virtualenv"
VIRTUAL_ENV_SHARE="/usr/share/python-virtualenv/"
@ -19,12 +40,12 @@ EXTRAOPTION=$(virtualenv --help | grep extra-search-dir)
if [ "$?" -eq "0" ]; then
virtualenv --extra-search-dir=${SCRIPTPATH}/3rd_party --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv || exit 1
else
# copy distribute-0.6.10.tar.gz to /usr/share/python-virtualenv/
# this is due to the bug in virtualenv 1.4.9
if [ -d "$VIRTUAL_ENV_SHARE" ]; then
# copy distribute-0.6.10.tar.gz to /usr/share/python-virtualenv/
# this is due to the bug in virtualenv 1.4.9
if [ -d "$VIRTUAL_ENV_SHARE" ]; then
cp ${SCRIPTPATH}/3rd_party/distribute-0.6.10.tar.gz /usr/share/python-virtualenv/
fi
virtualenv --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv || exit 1
fi
virtualenv --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv || exit 1
fi
echo -e "\n*** Installing Python Libraries ***"

View File

@ -76,7 +76,7 @@ if(Application_Model_Preference::GetSupportFeedback() == '1'){
// Get latest version from stat server and store to db
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
$url = 'http://stat-dev.sourcefabric.org/airtime_latest_version';
$url = 'http://stat.sourcefabric.org/airtime_latest_version';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);