CC-84: Smart Playlists

- fixed the issue where block length wasn't updated on spl section
This commit is contained in:
James 2012-07-26 10:49:23 -04:00
parent bef9ba1eea
commit 9bd823ee2c
3 changed files with 8 additions and 8 deletions

View File

@ -903,11 +903,11 @@ class Application_Model_Block
foreach ($data['criteria'] as $key=>$d){
$error = array();
$column = CcFilesPeer::getTableMap()->getColumnByPhpName(self::$criteria2PeerMap[$d['sp_criteria_field']]);
// check for not selected select box
if ($d['sp_criteria_field'] == "0" || $d['sp_criteria_modifier'] == "0"){
$error[] = "You must select Criteria and Modifier";
} else {
$column = CcFilesPeer::getTableMap()->getColumnByPhpName(self::$criteria2PeerMap[$d['sp_criteria_field']]);
// validation on type of column
if ($d['sp_criteria_field'] == 'length') {
if (!preg_match("/(\d{2}):(\d{2}):(\d{2})/", $d['sp_criteria_value'])) {

View File

@ -78,7 +78,7 @@ class CcBlock extends BaseCcBlock {
/**
* Computes the value of the aggregate column length
* Overridden to provide a default of 00:00:00 if the playlist is empty.
* Overridden to provide a default of 00:00:00 if the block is empty.
*
* @param PropelPDO $con A connection object
*
@ -86,7 +86,7 @@ class CcBlock extends BaseCcBlock {
*/
public function computeDbLength(PropelPDO $con)
{
$stmt = $con->prepare('SELECT SUM(cliplength) FROM "cc_playlistcontents" WHERE cc_playlistcontents.PLAYLIST_ID = :p1');
$stmt = $con->prepare('SELECT SUM(cliplength) FROM "cc_blockcontents" WHERE cc_blockcontents.BLOCK_ID = :p1');
$stmt->bindValue(':p1', $this->getDbId());
$stmt->execute();
$length = $stmt->fetchColumn();

View File

@ -40,7 +40,7 @@ class CcBlockcontents extends BaseCcBlockcontents {
*
* @param String in format SS.uuuuuu, Datetime, or DateTime accepted string.
*
* @return CcPlaylistcontents The current object (for fluent API support)
* @return CcBlockcontents The current object (for fluent API support)
*/
public function setDbFadein($v)
{
@ -59,7 +59,7 @@ class CcBlockcontents extends BaseCcBlockcontents {
}
$this->fadein = $dt->format('H:i:s.u');
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
$this->modifiedColumns[] = CcBlockcontentsPeer::FADEIN;
return $this;
} // setDbFadein()
@ -68,7 +68,7 @@ class CcBlockcontents extends BaseCcBlockcontents {
*
* @param String in format SS.uuuuuu, Datetime, or DateTime accepted string.
*
* @return CcPlaylistcontents The current object (for fluent API support)
* @return CcBlockcontents The current object (for fluent API support)
*/
public function setDbFadeout($v)
{
@ -87,7 +87,7 @@ class CcBlockcontents extends BaseCcBlockcontents {
}
$this->fadeout = $dt->format('H:i:s.u');
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
$this->modifiedColumns[] = CcBlockcontentsPeer::FADEOUT;
return $this;
} // setDbFadeout()