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){ foreach ($data['criteria'] as $key=>$d){
$error = array(); $error = array();
$column = CcFilesPeer::getTableMap()->getColumnByPhpName(self::$criteria2PeerMap[$d['sp_criteria_field']]);
// check for not selected select box // check for not selected select box
if ($d['sp_criteria_field'] == "0" || $d['sp_criteria_modifier'] == "0"){ if ($d['sp_criteria_field'] == "0" || $d['sp_criteria_modifier'] == "0"){
$error[] = "You must select Criteria and Modifier"; $error[] = "You must select Criteria and Modifier";
} else { } else {
$column = CcFilesPeer::getTableMap()->getColumnByPhpName(self::$criteria2PeerMap[$d['sp_criteria_field']]);
// validation on type of column // validation on type of column
if ($d['sp_criteria_field'] == 'length') { if ($d['sp_criteria_field'] == 'length') {
if (!preg_match("/(\d{2}):(\d{2}):(\d{2})/", $d['sp_criteria_value'])) { 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 * 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 * @param PropelPDO $con A connection object
* *
@ -86,7 +86,7 @@ class CcBlock extends BaseCcBlock {
*/ */
public function computeDbLength(PropelPDO $con) 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->bindValue(':p1', $this->getDbId());
$stmt->execute(); $stmt->execute();
$length = $stmt->fetchColumn(); $length = $stmt->fetchColumn();

View File

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