-better naming of show instance functions
This commit is contained in:
parent
1c5b2dc813
commit
f7fb6ddff0
|
@ -415,7 +415,7 @@ class ApiController extends Zend_Controller_Action
|
|||
$show_inst->setRecordedFile($file_id);
|
||||
$show_name = $show_inst->getName();
|
||||
$show_genre = $show_inst->getGenre();
|
||||
$show_start_time = ConvertToLocalDateTimeString($show_inst->getShowStart());
|
||||
$show_start_time = ConvertToLocalDateTimeString($show_inst->getShowInstanceStart());
|
||||
|
||||
} catch (Exception $e){
|
||||
//we've reached here probably because the show was
|
||||
|
|
|
@ -182,8 +182,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
$params = '/format/json/id/#id#';
|
||||
|
||||
$showStartDateHelper = Application_Model_DateHelper::ConvertToLocalDateTime($show->getShowStart());
|
||||
$showEndDateHelper = Application_Model_DateHelper::ConvertToLocalDateTime($show->getShowEnd());
|
||||
$showStartDateHelper = Application_Model_DateHelper::ConvertToLocalDateTime($show->getShowInstanceStart());
|
||||
$showEndDateHelper = Application_Model_DateHelper::ConvertToLocalDateTime($show->getShowInstanceEnd());
|
||||
|
||||
$menu = array();
|
||||
|
||||
|
@ -356,8 +356,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
return false;
|
||||
}
|
||||
|
||||
$start_timestamp = $show->getShowStart();
|
||||
$end_timestamp = $show->getShowEnd();
|
||||
$start_timestamp = $show->getShowInstanceStart();
|
||||
$end_timestamp = $show->getShowInstanceEnd();
|
||||
|
||||
//check to make sure show doesn't overlap.
|
||||
if(Application_Model_Show::getShows(new DateTime($start_timestamp, new DateTimeZone("UTC")),
|
||||
|
@ -409,7 +409,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
return false;
|
||||
}
|
||||
$originalShowName = $originalShow->getName();
|
||||
$originalShowStart = $originalShow->getShowStart();
|
||||
$originalShowStart = $originalShow->getShowInstanceStart();
|
||||
|
||||
$timestamp = strtotime($originalShowStart);
|
||||
$this->view->additionalShowInfo =
|
||||
|
@ -466,8 +466,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
'add_show_genre' => $show->getGenre(),
|
||||
'add_show_description' => $show->getDescription()));
|
||||
|
||||
$startsDateTime = new DateTime($showInstance->getShowStart(), new DateTimeZone("UTC"));
|
||||
$endsDateTime = new DateTime($showInstance->getShowEnd(), new DateTimeZone("UTC"));
|
||||
$startsDateTime = new DateTime($showInstance->getShowInstanceStart(), new DateTimeZone("UTC"));
|
||||
$endsDateTime = new DateTime($showInstance->getShowInstanceEnd(), new DateTimeZone("UTC"));
|
||||
|
||||
$startsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
||||
$endsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
||||
|
@ -761,7 +761,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
}
|
||||
$show = new Application_Model_Show($showInstance->getShowId());
|
||||
|
||||
$show->cancelShow($showInstance->getShowStart());
|
||||
$show->cancelShow($showInstance->getShowInstanceStart());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,21 +26,21 @@ class Application_Model_Dashboard
|
|||
if ($showInstance->isRecorded()){
|
||||
//last item is a show instance
|
||||
return array("name"=>$showInstance->getName(),
|
||||
"starts"=>$showInstance->getShowStart(),
|
||||
"ends"=>$showInstance->getShowEnd());
|
||||
"starts"=>$showInstance->getShowInstanceStart(),
|
||||
"ends"=>$showInstance->getShowInstanceEnd());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
//return the one that started later.
|
||||
if ($row[0]["starts"] >= $showInstance->getShowStart()){
|
||||
if ($row[0]["starts"] >= $showInstance->getShowInstanceStart()){
|
||||
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
|
||||
"starts"=>$row[0]["starts"],
|
||||
"ends"=>$row[0]["ends"]);
|
||||
} else {
|
||||
return array("name"=>$showInstance->getName(),
|
||||
"starts"=>$showInstance->getShowStart(),
|
||||
"ends"=>$showInstance->getShowEnd());
|
||||
"starts"=>$showInstance->getShowInstanceStart(),
|
||||
"ends"=>$showInstance->getShowInstanceEnd());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,8 +75,8 @@ class Application_Model_Dashboard
|
|||
//last item is a show instance
|
||||
if ($showInstance->isRecorded()){
|
||||
return array("name"=>$showInstance->getName(),
|
||||
"starts"=>$showInstance->getShowStart(),
|
||||
"ends"=>$showInstance->getShowEnd(),
|
||||
"starts"=>$showInstance->getShowInstanceStart(),
|
||||
"ends"=>$showInstance->getShowInstanceEnd(),
|
||||
"media_item_played"=>false,
|
||||
"record"=>true);
|
||||
} else {
|
||||
|
@ -114,22 +114,22 @@ class Application_Model_Dashboard
|
|||
if ($showInstance->isRecorded()){
|
||||
//last item is a show instance
|
||||
return array("name"=>$showInstance->getName(),
|
||||
"starts"=>$showInstance->getShowStart(),
|
||||
"ends"=>$showInstance->getShowEnd());
|
||||
"starts"=>$showInstance->getShowInstanceStart(),
|
||||
"ends"=>$showInstance->getShowInstanceEnd());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
//return the one that starts sooner.
|
||||
|
||||
if ($row[0]["starts"] <= $showInstance->getShowStart()){
|
||||
if ($row[0]["starts"] <= $showInstance->getShowInstanceStart()){
|
||||
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
|
||||
"starts"=>$row[0]["starts"],
|
||||
"ends"=>$row[0]["ends"]);
|
||||
} else {
|
||||
return array("name"=>$showInstance->getName(),
|
||||
"starts"=>$showInstance->getShowStart(),
|
||||
"ends"=>$showInstance->getShowEnd());
|
||||
"starts"=>$showInstance->getShowInstanceStart(),
|
||||
"ends"=>$showInstance->getShowInstanceEnd());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,8 +81,8 @@ class Application_Model_Nowplaying
|
|||
$showId = $si->getShowId();
|
||||
$show = new Application_Model_Show($showId);
|
||||
|
||||
$showStartDateTime = Application_Model_DateHelper::ConvertToLocalDateTime($si->getShowStart());
|
||||
$showEndDateTime = Application_Model_DateHelper::ConvertToLocalDateTime($si->getShowEnd());
|
||||
$showStartDateTime = Application_Model_DateHelper::ConvertToLocalDateTime($si->getShowInstanceStart());
|
||||
$showEndDateTime = Application_Model_DateHelper::ConvertToLocalDateTime($si->getShowInstanceEnd());
|
||||
|
||||
//append show header row
|
||||
$data[] = self::CreateHeaderRow($show->getName(), $showStartDateTime->format("Y-m-d H:i:s"), $showEndDateTime->format("Y-m-d H:i:s"));
|
||||
|
|
|
@ -56,7 +56,7 @@ class Application_Model_ShowInstance {
|
|||
* @return string in format "Y-m-d H:i:s" (PHP time notation)
|
||||
* TODO: make this function return a DateTime object instead.
|
||||
*/
|
||||
public function getShowStart()
|
||||
public function getShowInstanceStart()
|
||||
{
|
||||
return $this->_showInstance->getDbStarts();
|
||||
}
|
||||
|
@ -66,21 +66,21 @@ class Application_Model_ShowInstance {
|
|||
* @return string in format "Y-m-d H:i:s" (PHP time notation)
|
||||
* TODO: make this function return a DateTime object instead.
|
||||
*/
|
||||
public function getShowEnd()
|
||||
public function getShowInstanceEnd()
|
||||
{
|
||||
return $this->_showInstance->getDbEnds();
|
||||
}
|
||||
|
||||
public function getStartDate()
|
||||
{
|
||||
$showStart = $this->getShowStart();
|
||||
$showStart = $this->getShowInstanceStart();
|
||||
$showStartExplode = explode(" ", $showStart);
|
||||
return $showStartExplode[0];
|
||||
}
|
||||
|
||||
public function getStartTime()
|
||||
{
|
||||
$showStart = $this->getShowStart();
|
||||
$showStart = $this->getShowInstanceStart();
|
||||
$showStartExplode = explode(" ", $showStart);
|
||||
|
||||
return $showStartExplode[1];
|
||||
|
@ -150,7 +150,7 @@ class Application_Model_ShowInstance {
|
|||
|
||||
if (!is_null($scheduleStarts)){
|
||||
$scheduleStartsEpoch = strtotime($scheduleStarts);
|
||||
$showStartsEpoch = strtotime($this->getShowStart());
|
||||
$showStartsEpoch = strtotime($this->getShowInstanceStart());
|
||||
|
||||
$diff = $showStartsEpoch - $scheduleStartsEpoch;
|
||||
|
||||
|
@ -183,8 +183,8 @@ class Application_Model_ShowInstance {
|
|||
$mins = abs($deltaMin%60);
|
||||
|
||||
$today_timestamp = time();
|
||||
$starts = $this->getShowStart();
|
||||
$ends = $this->getShowEnd();
|
||||
$starts = $this->getShowInstanceStart();
|
||||
$ends = $this->getShowInstanceEnd();
|
||||
|
||||
$startsDateTime = new DateTime($starts, new DateTimeZone("UTC"));
|
||||
|
||||
|
@ -247,8 +247,8 @@ class Application_Model_ShowInstance {
|
|||
$mins = abs($deltaMin%60);
|
||||
|
||||
$today_timestamp = date("Y-m-d H:i:s");
|
||||
$starts = $this->getShowStart();
|
||||
$ends = $this->getShowEnd();
|
||||
$starts = $this->getShowInstanceStart();
|
||||
$ends = $this->getShowInstanceEnd();
|
||||
|
||||
if(strtotime($today_timestamp) > strtotime($starts)) {
|
||||
return "can't resize a past show";
|
||||
|
@ -303,7 +303,7 @@ class Application_Model_ShowInstance {
|
|||
$lastGroupId = $this->getLastGroupId();
|
||||
|
||||
if (is_null($lastGroupId)) {
|
||||
$groupId = $sched->add($this->_instanceId, $this->getShowStart(), null, $plId);
|
||||
$groupId = $sched->add($this->_instanceId, $this->getShowInstanceStart(), null, $plId);
|
||||
}
|
||||
else {
|
||||
$groupId = $sched->addPlaylistAfter($this->_instanceId, $lastGroupId, $plId);
|
||||
|
@ -323,7 +323,7 @@ class Application_Model_ShowInstance {
|
|||
$lastGroupId = $this->getLastGroupId();
|
||||
|
||||
if (is_null($lastGroupId)) {
|
||||
$groupId = $sched->add($this->_instanceId, $this->getShowStart(), $file_id);
|
||||
$groupId = $sched->add($this->_instanceId, $this->getShowInstanceStart(), $file_id);
|
||||
}
|
||||
else {
|
||||
$groupId = $sched->addFileAfter($this->_instanceId, $lastGroupId, $file_id);
|
||||
|
@ -440,8 +440,8 @@ class Application_Model_ShowInstance {
|
|||
|
||||
public function getPercentScheduled()
|
||||
{
|
||||
$start_timestamp = $this->getShowStart();
|
||||
$end_timestamp = $this->getShowEnd();
|
||||
$start_timestamp = $this->getShowInstanceStart();
|
||||
$end_timestamp = $this->getShowInstanceEnd();
|
||||
$time_filled = $this->getTimeScheduled();
|
||||
|
||||
$s_epoch = strtotime($start_timestamp);
|
||||
|
@ -460,8 +460,8 @@ class Application_Model_ShowInstance {
|
|||
{
|
||||
global $CC_DBC;
|
||||
|
||||
$start_timestamp = $this->getShowStart();
|
||||
$end_timestamp = $this->getShowEnd();
|
||||
$start_timestamp = $this->getShowInstanceStart();
|
||||
$end_timestamp = $this->getShowInstanceEnd();
|
||||
|
||||
$sql = "SELECT TIMESTAMP '{$end_timestamp}' - TIMESTAMP '{$start_timestamp}' ";
|
||||
$length = $CC_DBC->GetOne($sql);
|
||||
|
@ -596,11 +596,11 @@ class Application_Model_ShowInstance {
|
|||
}
|
||||
|
||||
public function getShowEndGapTime(){
|
||||
$showEnd = $this->getShowEnd();
|
||||
$showEnd = $this->getShowInstanceEnd();
|
||||
$lastItemEnd = $this->getLastAudioItemEnd();
|
||||
|
||||
if (is_null($lastItemEnd)){
|
||||
$lastItemEnd = $this->getShowStart();
|
||||
$lastItemEnd = $this->getShowInstanceStart();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue