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']);
|
$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 {
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue