Whitespace and deadcode nitpick

This commit is contained in:
Lucas Bickel 2017-03-10 16:20:44 +01:00
parent 6e50af344a
commit 2a53241ba3
15 changed files with 59 additions and 122 deletions

View file

@ -1,7 +1,6 @@
<?php
class AutoPlaylistManager {
/**
* @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);
}
/*
* 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.
@ -45,7 +43,6 @@ class AutoPlaylistManager {
}
}
/**
* 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();
}
/**
* 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)
->find();
}
}

View file

@ -223,7 +223,6 @@ class CeleryTask implements AirtimeTask {
}
/**
*
* Class AutoPlaylistTask
*
* Checks for shows with an autoplaylist that needs to be filled in
@ -231,7 +230,6 @@ class CeleryTask implements AirtimeTask {
*/
class AutoPlaylistTask implements AirtimeTask
{
/**
* Checks whether or not the autoplaylist polling interval has passed
*
@ -251,8 +249,6 @@ class AutoPlaylistTask implements AirtimeTask
}
}
/**
* Class PodcastTask
*

View file

@ -1,6 +1,6 @@
<?php
// 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 (
'datasources' =>
array (
@ -22,14 +22,6 @@ $conf = array (
),
'default' => 'airtime',
),
'log' =>
array (
'type' => 'file',
'name' => './propel.log',
'ident' => 'propel',
'level' => '7',
'conf' => '',
),
'generator_version' => '1.7.0',
);
$conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-airtime-conf.php');

View file

@ -8,8 +8,6 @@ class Application_Form_AddShowAutoPlaylist extends Zend_Form_SubForm
array('ViewScript', array('viewScript' => 'form/add-show-autoplaylist.phtml'))
));
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
// retrieves the length limit for each char field
// 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->setLabel(_("Select Playlist"));
$autoPlaylistSelect->setMultiOptions($this->getPlaylistNames());
$autoPlaylistSelect->setMultiOptions(Application_Model_Library::getPlaylistNames());
$autoPlaylistSelect->setValue(null);
$autoPlaylistSelect->setDecorators(array('ViewHelper'));
$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()
{
$elements = $this->getElements();

View file

@ -59,7 +59,6 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
$descText = $this->getElement('add_show_description');
$descText->setDecorators(array(array('ViewScript', array(
'viewScript' => 'form/add-show-block.phtml',
'class' => 'block-display'
@ -80,30 +79,9 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
'class' => 'block-display'
))));
$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
*/
public function enableInstanceDesc()

View file

@ -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;
}
}

View file

@ -129,7 +129,6 @@ class Application_Model_Show
return $this->_showId;
}
public function getHasAutoPlaylist()
{
$show = CcShowQuery::create()->findPK($this->_showId);
@ -156,7 +155,6 @@ class Application_Model_Show
$show->setDbAutoPlaylistId($playlistid);
}
public function getHosts()
{
$sql = <<<SQL

View file

@ -169,17 +169,12 @@ SQL;
->save();
}
public function updateScheduledTime()
{
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME);
$this->_showInstance->updateDbTimeFilled($con);
}
public function isDeleted()
{
$this->_showInstance->getDbModifiedInstance();

View file

@ -134,7 +134,6 @@ class Application_Service_ShowFormService
{
$ccShowInstance = CcShowInstancesQuery::create()->findPk($this->instanceId);
$form->populate(
array(
'add_show_instance_id' => $this->instanceId,
@ -146,14 +145,11 @@ class Application_Service_ShowFormService
'add_show_instance_description' => $ccShowInstance->getDbDescription(),
));
}
private function populateFormAutoPlaylist($form)
{
$ccShowInstance = CcShowInstancesQuery::create()->findPk($this->instanceId);
if (!$this->ccShow->getDbAutoPlaylistId()) {
// $form->disableAutoPlaylist();
}
$form->populate(
array(
'add_show_has_autoplaylist' => $this->ccShow->getDbHasAutoPlaylist() ? 1 : 0,

View file

@ -20,4 +20,3 @@
</div>
</dl>
</fieldset>

View file

@ -13,5 +13,3 @@
}
?>
</dd>

View file

@ -15,7 +15,6 @@
<div id="schedule-show-what" class="collapsible-content">
<?php echo $this->autoplaylist; ?>
</div>
<h3 class="collapsible-header"><span class="arrow-icon"></span><?php echo _("When") ?></h3>
<div id="schedule-show-when" class="collapsible-content">
<?php

View file

@ -274,7 +274,6 @@ function setAddShowEvents(form) {
$("#add_show_playlist_dropdown").show();
}
if(!form.find("#add_show_repeats").attr('checked')) {
form.find("#schedule-show-when > fieldset:last").hide();
$("#add_show_rebroadcast_relative").hide();
@ -313,7 +312,6 @@ function setAddShowEvents(form) {
}
});
form.find("#add_show_repeats").click(function(){
$(this).blur();
form.find("#schedule-show-when > fieldset:last").toggle();