Whitespace and deadcode nitpick
This commit is contained in:
parent
6e50af344a
commit
2a53241ba3
15 changed files with 59 additions and 122 deletions
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class AutoPlaylistManager {
|
class AutoPlaylistManager {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int how often, in seconds, to check for and ingest new podcast episodes
|
* @var int how often, in seconds, to check for and ingest new podcast episodes
|
||||||
*/
|
*/
|
||||||
|
@ -19,7 +18,6 @@ class AutoPlaylistManager {
|
||||||
return empty($lastPolled) || (microtime(true) > $lastPolled + self::$_AUTOPLAYLIST_POLL_INTERVAL_SECONDS);
|
return empty($lastPolled) || (microtime(true) > $lastPolled + self::$_AUTOPLAYLIST_POLL_INTERVAL_SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function is copied from the TestUser class and is used to instantiate a user so that
|
* This function is copied from the TestUser class and is used to instantiate a user so that
|
||||||
* the Scheduler model can be utilized by buildAutoPlaylist.
|
* the Scheduler model can be utilized by buildAutoPlaylist.
|
||||||
|
@ -45,7 +43,6 @@ class AutoPlaylistManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find all shows with autoplaylists who have yet to have their playlists built and added to the schedule
|
* Find all shows with autoplaylists who have yet to have their playlists built and added to the schedule
|
||||||
*
|
*
|
||||||
|
@ -70,7 +67,6 @@ class AutoPlaylistManager {
|
||||||
Zend_Session::stop();
|
Zend_Session::stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find all show instances starting in the next hour with autoplaylists not yet added to the schedule
|
* Find all show instances starting in the next hour with autoplaylists not yet added to the schedule
|
||||||
*
|
*
|
||||||
|
@ -93,5 +89,4 @@ class AutoPlaylistManager {
|
||||||
->filterByDbAutoPlaylistBuilt(false)
|
->filterByDbAutoPlaylistBuilt(false)
|
||||||
->find();
|
->find();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,7 +223,6 @@ class CeleryTask implements AirtimeTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Class AutoPlaylistTask
|
* Class AutoPlaylistTask
|
||||||
*
|
*
|
||||||
* Checks for shows with an autoplaylist that needs to be filled in
|
* Checks for shows with an autoplaylist that needs to be filled in
|
||||||
|
@ -231,7 +230,6 @@ class CeleryTask implements AirtimeTask {
|
||||||
*/
|
*/
|
||||||
class AutoPlaylistTask implements AirtimeTask
|
class AutoPlaylistTask implements AirtimeTask
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether or not the autoplaylist polling interval has passed
|
* Checks whether or not the autoplaylist polling interval has passed
|
||||||
*
|
*
|
||||||
|
@ -251,8 +249,6 @@ class AutoPlaylistTask implements AirtimeTask
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PodcastTask
|
* Class PodcastTask
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
// This file generated by Propel 1.7.0 convert-conf target
|
// This file generated by Propel 1.7.0 convert-conf target
|
||||||
// from XML runtime conf file /home/wcrs/airtime-dev-test/airtime_mvc/build/runtime-conf.xml
|
// from XML runtime conf file /home/sourcefabric/dev/Airtime/airtime_mvc/build/runtime-conf.xml
|
||||||
$conf = array (
|
$conf = array (
|
||||||
'datasources' =>
|
'datasources' =>
|
||||||
array (
|
array (
|
||||||
|
@ -22,14 +22,6 @@ $conf = array (
|
||||||
),
|
),
|
||||||
'default' => 'airtime',
|
'default' => 'airtime',
|
||||||
),
|
),
|
||||||
'log' =>
|
|
||||||
array (
|
|
||||||
'type' => 'file',
|
|
||||||
'name' => './propel.log',
|
|
||||||
'ident' => 'propel',
|
|
||||||
'level' => '7',
|
|
||||||
'conf' => '',
|
|
||||||
),
|
|
||||||
'generator_version' => '1.7.0',
|
'generator_version' => '1.7.0',
|
||||||
);
|
);
|
||||||
$conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-airtime-conf.php');
|
$conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-airtime-conf.php');
|
||||||
|
|
|
@ -8,8 +8,6 @@ class Application_Form_AddShowAutoPlaylist extends Zend_Form_SubForm
|
||||||
array('ViewScript', array('viewScript' => 'form/add-show-autoplaylist.phtml'))
|
array('ViewScript', array('viewScript' => 'form/add-show-autoplaylist.phtml'))
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
|
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
|
||||||
// retrieves the length limit for each char field
|
// retrieves the length limit for each char field
|
||||||
// and store to assoc array
|
// and store to assoc array
|
||||||
|
@ -25,31 +23,12 @@ class Application_Form_AddShowAutoPlaylist extends Zend_Form_SubForm
|
||||||
|
|
||||||
$autoPlaylistSelect = new Zend_Form_Element_Select("add_show_autoplaylist_id");
|
$autoPlaylistSelect = new Zend_Form_Element_Select("add_show_autoplaylist_id");
|
||||||
$autoPlaylistSelect->setLabel(_("Select Playlist"));
|
$autoPlaylistSelect->setLabel(_("Select Playlist"));
|
||||||
$autoPlaylistSelect->setMultiOptions($this->getPlaylistNames());
|
$autoPlaylistSelect->setMultiOptions(Application_Model_Library::getPlaylistNames());
|
||||||
$autoPlaylistSelect->setValue(null);
|
$autoPlaylistSelect->setValue(null);
|
||||||
$autoPlaylistSelect->setDecorators(array('ViewHelper'));
|
$autoPlaylistSelect->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($autoPlaylistSelect);
|
$this->addElement($autoPlaylistSelect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function getPlaylistNames()
|
|
||||||
{
|
|
||||||
$playlistNames = array(NULL => _("None"));
|
|
||||||
|
|
||||||
|
|
||||||
$playlists = CcPlaylistQuery::create()
|
|
||||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
|
||||||
->find();
|
|
||||||
|
|
||||||
foreach ($playlists as $playlist) {
|
|
||||||
|
|
||||||
$playlistNames[$playlist->getDbId()] = $playlist->getDbName();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $playlistNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function disable()
|
public function disable()
|
||||||
{
|
{
|
||||||
$elements = $this->getElements();
|
$elements = $this->getElements();
|
||||||
|
|
|
@ -59,7 +59,6 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
|
||||||
|
|
||||||
$descText = $this->getElement('add_show_description');
|
$descText = $this->getElement('add_show_description');
|
||||||
|
|
||||||
|
|
||||||
$descText->setDecorators(array(array('ViewScript', array(
|
$descText->setDecorators(array(array('ViewScript', array(
|
||||||
'viewScript' => 'form/add-show-block.phtml',
|
'viewScript' => 'form/add-show-block.phtml',
|
||||||
'class' => 'block-display'
|
'class' => 'block-display'
|
||||||
|
@ -80,29 +79,8 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
|
||||||
'class' => 'block-display'
|
'class' => 'block-display'
|
||||||
))));
|
))));
|
||||||
$instanceDesc->setAttrib('disabled','disabled');
|
$instanceDesc->setAttrib('disabled','disabled');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function getPlaylistNames()
|
|
||||||
{
|
|
||||||
$playlistNames = array(NULL => _("None"));
|
|
||||||
|
|
||||||
|
|
||||||
$playlists = CcPlaylistQuery::create()
|
|
||||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
|
||||||
->find();
|
|
||||||
|
|
||||||
foreach ($playlists as $playlist) {
|
|
||||||
|
|
||||||
$playlistNames[$playlist->getDbId()] = $playlist->getDbName();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $playlistNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable the instance description when editing a show instance
|
* Enable the instance description when editing a show instance
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -33,4 +33,18 @@ class Application_Model_Library
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getPlaylistNames()
|
||||||
|
{
|
||||||
|
$playlistNames = array(NULL => _("None"));
|
||||||
|
|
||||||
|
$playlists = CcPlaylistQuery::create()
|
||||||
|
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||||
|
->find();
|
||||||
|
|
||||||
|
foreach ($playlists as $playlist) {
|
||||||
|
$playlistNames[$playlist->getDbId()] = $playlist->getDbName();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $playlistNames;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,7 +129,6 @@ class Application_Model_Show
|
||||||
return $this->_showId;
|
return $this->_showId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getHasAutoPlaylist()
|
public function getHasAutoPlaylist()
|
||||||
{
|
{
|
||||||
$show = CcShowQuery::create()->findPK($this->_showId);
|
$show = CcShowQuery::create()->findPK($this->_showId);
|
||||||
|
@ -156,7 +155,6 @@ class Application_Model_Show
|
||||||
$show->setDbAutoPlaylistId($playlistid);
|
$show->setDbAutoPlaylistId($playlistid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getHosts()
|
public function getHosts()
|
||||||
{
|
{
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
|
|
|
@ -169,17 +169,12 @@ SQL;
|
||||||
->save();
|
->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function updateScheduledTime()
|
public function updateScheduledTime()
|
||||||
{
|
{
|
||||||
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME);
|
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME);
|
||||||
$this->_showInstance->updateDbTimeFilled($con);
|
$this->_showInstance->updateDbTimeFilled($con);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function isDeleted()
|
public function isDeleted()
|
||||||
{
|
{
|
||||||
$this->_showInstance->getDbModifiedInstance();
|
$this->_showInstance->getDbModifiedInstance();
|
||||||
|
|
|
@ -134,7 +134,6 @@ class Application_Service_ShowFormService
|
||||||
{
|
{
|
||||||
$ccShowInstance = CcShowInstancesQuery::create()->findPk($this->instanceId);
|
$ccShowInstance = CcShowInstancesQuery::create()->findPk($this->instanceId);
|
||||||
|
|
||||||
|
|
||||||
$form->populate(
|
$form->populate(
|
||||||
array(
|
array(
|
||||||
'add_show_instance_id' => $this->instanceId,
|
'add_show_instance_id' => $this->instanceId,
|
||||||
|
@ -146,14 +145,11 @@ class Application_Service_ShowFormService
|
||||||
'add_show_instance_description' => $ccShowInstance->getDbDescription(),
|
'add_show_instance_description' => $ccShowInstance->getDbDescription(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function populateFormAutoPlaylist($form)
|
private function populateFormAutoPlaylist($form)
|
||||||
{
|
{
|
||||||
$ccShowInstance = CcShowInstancesQuery::create()->findPk($this->instanceId);
|
$ccShowInstance = CcShowInstancesQuery::create()->findPk($this->instanceId);
|
||||||
|
|
||||||
if (!$this->ccShow->getDbAutoPlaylistId()) {
|
|
||||||
// $form->disableAutoPlaylist();
|
|
||||||
}
|
|
||||||
|
|
||||||
$form->populate(
|
$form->populate(
|
||||||
array(
|
array(
|
||||||
'add_show_has_autoplaylist' => $this->ccShow->getDbHasAutoPlaylist() ? 1 : 0,
|
'add_show_has_autoplaylist' => $this->ccShow->getDbHasAutoPlaylist() ? 1 : 0,
|
||||||
|
|
|
@ -20,4 +20,3 @@
|
||||||
</div>
|
</div>
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|
|
@ -13,5 +13,3 @@
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
<div id="schedule-show-what" class="collapsible-content">
|
<div id="schedule-show-what" class="collapsible-content">
|
||||||
<?php echo $this->autoplaylist; ?>
|
<?php echo $this->autoplaylist; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="collapsible-header"><span class="arrow-icon"></span><?php echo _("When") ?></h3>
|
<h3 class="collapsible-header"><span class="arrow-icon"></span><?php echo _("When") ?></h3>
|
||||||
<div id="schedule-show-when" class="collapsible-content">
|
<div id="schedule-show-when" class="collapsible-content">
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -274,7 +274,6 @@ function setAddShowEvents(form) {
|
||||||
$("#add_show_playlist_dropdown").show();
|
$("#add_show_playlist_dropdown").show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!form.find("#add_show_repeats").attr('checked')) {
|
if(!form.find("#add_show_repeats").attr('checked')) {
|
||||||
form.find("#schedule-show-when > fieldset:last").hide();
|
form.find("#schedule-show-when > fieldset:last").hide();
|
||||||
$("#add_show_rebroadcast_relative").hide();
|
$("#add_show_rebroadcast_relative").hide();
|
||||||
|
@ -313,7 +312,6 @@ function setAddShowEvents(form) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
form.find("#add_show_repeats").click(function(){
|
form.find("#add_show_repeats").click(function(){
|
||||||
$(this).blur();
|
$(this).blur();
|
||||||
form.find("#schedule-show-when > fieldset:last").toggle();
|
form.find("#schedule-show-when > fieldset:last").toggle();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue