CRLF
This commit is contained in:
parent
0dd5458269
commit
1fa13eed13
3 changed files with 36 additions and 36 deletions
|
@ -1075,7 +1075,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
$webstream_metadata->setDbLiquidsoapData($data_title);
|
$webstream_metadata->setDbLiquidsoapData($data_title);
|
||||||
$webstream_metadata->save();
|
$webstream_metadata->save();
|
||||||
|
|
||||||
$historyService = new Application_Service_HistoryService();
|
$historyService = new Application_Service_HistoryService();
|
||||||
$historyService->insertWebstreamMetadata($media_id, $startDT, $data_arr);
|
$historyService->insertWebstreamMetadata($media_id, $startDT, $data_arr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,20 +15,20 @@
|
||||||
*/
|
*/
|
||||||
class CcPlayoutHistoryMetaData extends BaseCcPlayoutHistoryMetaData {
|
class CcPlayoutHistoryMetaData extends BaseCcPlayoutHistoryMetaData {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [value] column.
|
* Set the value of [value] column.
|
||||||
*
|
*
|
||||||
* @param string $v new value
|
* @param string $v new value
|
||||||
* @return CcPlayoutHistoryMetaData The current object (for fluent API support)
|
* @return CcPlayoutHistoryMetaData The current object (for fluent API support)
|
||||||
*/
|
*/
|
||||||
public function setDbValue($v)
|
public function setDbValue($v)
|
||||||
{
|
{
|
||||||
//make sure the metadata isn't longer than the DB field.
|
//make sure the metadata isn't longer than the DB field.
|
||||||
$v = substr($v, 0, 128);
|
$v = substr($v, 0, 128);
|
||||||
|
|
||||||
parent::setDbValue($v);
|
parent::setDbValue($v);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
} // setDbValue()
|
} // setDbValue()
|
||||||
|
|
||||||
} // CcPlayoutHistoryMetaData
|
} // CcPlayoutHistoryMetaData
|
||||||
|
|
|
@ -511,43 +511,43 @@ class Application_Service_HistoryService
|
||||||
|
|
||||||
public function insertWebstreamMetadata($schedId, $startDT, $data) {
|
public function insertWebstreamMetadata($schedId, $startDT, $data) {
|
||||||
|
|
||||||
$this->con->beginTransaction();
|
$this->con->beginTransaction();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$item = CcScheduleQuery::create()->findPK($schedId, $this->con);
|
$item = CcScheduleQuery::create()->findPK($schedId, $this->con);
|
||||||
|
|
||||||
//TODO figure out how to combine these all into 1 query.
|
//TODO figure out how to combine these all into 1 query.
|
||||||
$showInstance = $item->getCcShowInstances($this->con);
|
$showInstance = $item->getCcShowInstances($this->con);
|
||||||
$show = $showInstance->getCcShow($this->con);
|
$show = $showInstance->getCcShow($this->con);
|
||||||
|
|
||||||
$webstream = $item->getCcWebstream($this->con);
|
$webstream = $item->getCcWebstream($this->con);
|
||||||
|
|
||||||
$metadata = array();
|
$metadata = array();
|
||||||
$metadata["showname"] = $show->getDbName();
|
$metadata["showname"] = $show->getDbName();
|
||||||
$metadata[MDATA_KEY_TITLE] = $data->title;
|
$metadata[MDATA_KEY_TITLE] = $data->title;
|
||||||
$metadata[MDATA_KEY_CREATOR] = $webstream->getDbName();
|
$metadata[MDATA_KEY_CREATOR] = $webstream->getDbName();
|
||||||
|
|
||||||
$history = new CcPlayoutHistory();
|
$history = new CcPlayoutHistory();
|
||||||
$history->setDbStarts($startDT);
|
$history->setDbStarts($startDT);
|
||||||
$history->setDbEnds(null);
|
$history->setDbEnds(null);
|
||||||
$history->setDbInstanceId($item->getDbInstanceId());
|
$history->setDbInstanceId($item->getDbInstanceId());
|
||||||
|
|
||||||
foreach ($metadata as $key => $val) {
|
foreach ($metadata as $key => $val) {
|
||||||
$meta = new CcPlayoutHistoryMetaData();
|
$meta = new CcPlayoutHistoryMetaData();
|
||||||
$meta->setDbKey($key);
|
$meta->setDbKey($key);
|
||||||
$meta->setDbValue($val);
|
$meta->setDbValue($val);
|
||||||
|
|
||||||
$history->addCcPlayoutHistoryMetaData($meta);
|
$history->addCcPlayoutHistoryMetaData($meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
$history->save($this->con);
|
$history->save($this->con);
|
||||||
|
|
||||||
$this->con->commit();
|
$this->con->commit();
|
||||||
}
|
}
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
$this->con->rollback();
|
$this->con->rollback();
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue