Merge branch '2.2.x' into devel

Conflicts:
	airtime_mvc/application/controllers/PreferenceController.php
	airtime_mvc/application/models/StoredFile.php
	airtime_mvc/public/js/bootstrap/bootstrap.js
This commit is contained in:
denise 2012-11-07 11:21:36 -05:00
commit b817684972
33 changed files with 167 additions and 181 deletions

View file

@ -359,9 +359,27 @@ SQL;
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
}
// set file_exists falg to false
// set hidden falg to true
$this->_file->setDbHidden(true);
$this->_file->save();
// need to explicitly update any playlist's and block's length
// that contains the file getting deleted
$fileId = $this->_file->getDbId();
$plRows = CcPlaylistcontentsQuery::create()->filterByDbFileId()->find();
foreach ($plRows as $row) {
$pl = CcPlaylistQuery::create()->filterByDbId($row->getDbPlaylistId($fileId))->findOne();
$pl->setDbLength($pl->computeDbLength(Propel::getConnection(CcPlaylistPeer::DATABASE_NAME)));
$pl->save();
}
$blRows = CcBlockcontentsQuery::create()->filterByDbFileId($fileId)->find();
foreach ($blRows as $row) {
$bl = CcBlockQuery::create()->filterByDbId($row->getDbBlockId())->findOne();
$bl->setDbLength($bl->computeDbLength(Propel::getConnection(CcBlockPeer::DATABASE_NAME)));
$bl->save();
}
}
/**