Smart Playlists: code cleanup
This commit is contained in:
parent
ae0d5d8598
commit
0d21d9a9af
|
@ -534,7 +534,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$form->startForm($params['obj_id']);
|
||||
$bl = new Application_Model_Block($params['obj_id']);
|
||||
if ($form->isValid($params)) {
|
||||
$result = $bl->saveSmartBlockCriteria($params['data']);
|
||||
$bl->saveSmartBlockCriteria($params['data']);
|
||||
$result['html'] = $this->createFullResponse($bl, true);
|
||||
$result['result'] = 0;
|
||||
} else {
|
||||
|
|
|
@ -947,7 +947,6 @@ EOT;
|
|||
$this->storeCriteriaIntoDb($data);
|
||||
//get number of files that meet the criteria
|
||||
$files = $this->getListofFilesMeetCriteria();
|
||||
//$output['poolCount'] = $files["count"];
|
||||
// if the block is dynamic, put null to the length
|
||||
// as it cannot be calculated
|
||||
if ($blockType == 'dynamic') {
|
||||
|
@ -963,10 +962,8 @@ EOT;
|
|||
}
|
||||
$this->setLength($length);
|
||||
}
|
||||
//$output['blockLength'] = $this->getFormattedLength();
|
||||
|
||||
$this->updateBlockLengthInAllPlaylist();
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function hasItemLimit()
|
||||
|
@ -1018,17 +1015,13 @@ EOT;
|
|||
*/
|
||||
public function generateSmartBlock($p_criteria, $returnList=false)
|
||||
{
|
||||
$result = $this->saveSmartBlockCriteria($p_criteria);
|
||||
/*if ($result['result'] != 0) {
|
||||
return $result;
|
||||
} else {*/
|
||||
$insertList = $this->getListOfFilesUnderLimit();
|
||||
$this->deleteAllFilesFromBlock();
|
||||
$this->addAudioClips(array_keys($insertList));
|
||||
// update length in playlist contents.
|
||||
$this->updateBlockLengthInAllPlaylist();
|
||||
return array("result"=>0);
|
||||
//}
|
||||
$this->saveSmartBlockCriteria($p_criteria);
|
||||
$insertList = $this->getListOfFilesUnderLimit();
|
||||
$this->deleteAllFilesFromBlock();
|
||||
$this->addAudioClips(array_keys($insertList));
|
||||
// update length in playlist contents.
|
||||
$this->updateBlockLengthInAllPlaylist();
|
||||
return array("result"=>0);
|
||||
}
|
||||
|
||||
public function updateBlockLengthInAllPlaylist()
|
||||
|
|
Loading…
Reference in New Issue