Smart Playlists: code cleanup

This commit is contained in:
denise 2012-08-16 15:40:36 -04:00
parent ae0d5d8598
commit 0d21d9a9af
2 changed files with 8 additions and 15 deletions

View File

@ -534,7 +534,7 @@ class PlaylistController extends Zend_Controller_Action
$form->startForm($params['obj_id']); $form->startForm($params['obj_id']);
$bl = new Application_Model_Block($params['obj_id']); $bl = new Application_Model_Block($params['obj_id']);
if ($form->isValid($params)) { if ($form->isValid($params)) {
$result = $bl->saveSmartBlockCriteria($params['data']); $bl->saveSmartBlockCriteria($params['data']);
$result['html'] = $this->createFullResponse($bl, true); $result['html'] = $this->createFullResponse($bl, true);
$result['result'] = 0; $result['result'] = 0;
} else { } else {

View File

@ -947,7 +947,6 @@ EOT;
$this->storeCriteriaIntoDb($data); $this->storeCriteriaIntoDb($data);
//get number of files that meet the criteria //get number of files that meet the criteria
$files = $this->getListofFilesMeetCriteria(); $files = $this->getListofFilesMeetCriteria();
//$output['poolCount'] = $files["count"];
// if the block is dynamic, put null to the length // if the block is dynamic, put null to the length
// as it cannot be calculated // as it cannot be calculated
if ($blockType == 'dynamic') { if ($blockType == 'dynamic') {
@ -963,10 +962,8 @@ EOT;
} }
$this->setLength($length); $this->setLength($length);
} }
//$output['blockLength'] = $this->getFormattedLength();
$this->updateBlockLengthInAllPlaylist(); $this->updateBlockLengthInAllPlaylist();
return $output;
} }
public function hasItemLimit() public function hasItemLimit()
@ -1018,17 +1015,13 @@ EOT;
*/ */
public function generateSmartBlock($p_criteria, $returnList=false) public function generateSmartBlock($p_criteria, $returnList=false)
{ {
$result = $this->saveSmartBlockCriteria($p_criteria); $this->saveSmartBlockCriteria($p_criteria);
/*if ($result['result'] != 0) { $insertList = $this->getListOfFilesUnderLimit();
return $result; $this->deleteAllFilesFromBlock();
} else {*/ $this->addAudioClips(array_keys($insertList));
$insertList = $this->getListOfFilesUnderLimit(); // update length in playlist contents.
$this->deleteAllFilesFromBlock(); $this->updateBlockLengthInAllPlaylist();
$this->addAudioClips(array_keys($insertList)); return array("result"=>0);
// update length in playlist contents.
$this->updateBlockLengthInAllPlaylist();
return array("result"=>0);
//}
} }
public function updateBlockLengthInAllPlaylist() public function updateBlockLengthInAllPlaylist()