style(legacy): force semicolon on same line (#1534)
This commit is contained in:
parent
522d989cab
commit
8569af9328
85 changed files with 396 additions and 789 deletions
|
@ -45,8 +45,7 @@ class Application_Model_Auth
|
|||
CcSubjsTokenQuery::create()
|
||||
->filterByDbAction($action)
|
||||
->filterByDbUserId($user->getDbId())
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
|
||||
public function checkToken($user_id, $token, $action)
|
||||
|
@ -57,8 +56,7 @@ class Application_Model_Auth
|
|||
->filterByDbAction($action)
|
||||
->filterByDbUserId($user_id)
|
||||
->filterByDbToken(sha1($token . $salt))
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (empty($token_info)) {
|
||||
return false;
|
||||
|
@ -96,8 +94,7 @@ class Application_Model_Auth
|
|||
$authAdapter->setTableName('cc_subjs')
|
||||
->setIdentityColumn('login')
|
||||
->setCredentialColumn('pass')
|
||||
->setCredentialTreatment('MD5(?)')
|
||||
;
|
||||
->setCredentialTreatment('MD5(?)');
|
||||
|
||||
return $authAdapter;
|
||||
}
|
||||
|
|
|
@ -458,8 +458,7 @@ SQL;
|
|||
->filterByDbBlockId($this->id)
|
||||
->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
Logging::info('Adding to block');
|
||||
Logging::info("at position {$pos}");
|
||||
|
@ -475,16 +474,14 @@ SQL;
|
|||
$contentsToUpdate = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
}
|
||||
|
||||
$contentsToUpdate = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
Logging::info('Adding to block');
|
||||
Logging::info("at position {$pos}");
|
||||
|
@ -550,15 +547,13 @@ SQL;
|
|||
$contentsToMove = CcBlockcontentsQuery::create()
|
||||
->filterByDbId($p_items, Criteria::IN)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$otherContent = CcBlockcontentsQuery::create()
|
||||
->filterByDbId($p_items, Criteria::NOT_IN)
|
||||
->filterByDbBlockId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$pos = 0;
|
||||
//moving items to beginning of the block.
|
||||
|
@ -625,13 +620,11 @@ SQL;
|
|||
$itemsToDelete = CcBlockcontentsQuery::create()
|
||||
->filterByPrimaryKeys($p_items)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
CcBlockcontentsQuery::create()
|
||||
->findPKs($p_items)
|
||||
->delete($this->con)
|
||||
;
|
||||
->delete($this->con);
|
||||
|
||||
// now that the items have been deleted we can update the
|
||||
// is_playlist flag in cc_files
|
||||
|
@ -640,8 +633,7 @@ SQL;
|
|||
$contents = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
//reset the positions of the remaining items.
|
||||
for ($i = 0; $i < count($contents); ++$i) {
|
||||
|
@ -670,8 +662,7 @@ SQL;
|
|||
->joinWith(CcFilesPeer::OM_CLASS)
|
||||
->filterByDbBlockId($this->id)
|
||||
->filterByDbPosition($pos)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
//Propel returns values in form 00.000000 format which is for only seconds.
|
||||
//We only want to display 1 decimal
|
||||
|
@ -801,8 +792,7 @@ SQL;
|
|||
$row = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->filterByDbPosition(0)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
$this->changeFadeInfo($row->getDbId(), $fadein, null);
|
||||
}
|
||||
|
@ -812,8 +802,7 @@ SQL;
|
|||
$row = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->filterByDbPosition($this->getSize() - 1)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
$this->changeFadeInfo($row->getDbId(), null, $fadeout);
|
||||
}
|
||||
|
@ -848,8 +837,7 @@ SQL;
|
|||
$row = CcBlockcontentsQuery::create()
|
||||
->joinWith(CcFilesPeer::OM_CLASS)
|
||||
->filterByPrimaryKey($id)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
if (is_null($row)) {
|
||||
throw new Exception('Block item does not exist.');
|
||||
|
@ -1061,8 +1049,7 @@ SQL;
|
|||
$itemsToDelete = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($p_ids)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$updateIsPlaylistFlag = false;
|
||||
|
||||
|
@ -1115,8 +1102,7 @@ SQL;
|
|||
$itemsToDelete = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
CcBlockcontentsQuery::create()->findByDbBlockId($this->id)->delete();
|
||||
|
||||
|
@ -1141,8 +1127,7 @@ SQL;
|
|||
$contents = CcBlockcontentsQuery::create()
|
||||
->filterByDbBlockId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
$shuffledPos = range(0, count($contents) - 1);
|
||||
shuffle($shuffledPos);
|
||||
foreach ($contents as $item) {
|
||||
|
@ -1245,8 +1230,7 @@ SQL;
|
|||
$qry->setDbCriteria($field)
|
||||
->setDbModifier($d['sp_criteria_modifier'])
|
||||
->setDbValue($value)
|
||||
->setDbBlockId($this->id)
|
||||
;
|
||||
->setDbBlockId($this->id);
|
||||
|
||||
if (isset($d['sp_criteria_extra'])) {
|
||||
if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') {
|
||||
|
@ -1276,8 +1260,7 @@ SQL;
|
|||
->setDbModifier('N/A')
|
||||
->setDbValue($p_criteriaData['etc']['sp_sort_options'])
|
||||
->setDbBlockId($this->id)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
// insert limit info
|
||||
$qry = new CcBlockcriteria();
|
||||
|
@ -1285,8 +1268,7 @@ SQL;
|
|||
->setDbModifier($p_criteriaData['etc']['sp_limit_options'])
|
||||
->setDbValue($p_criteriaData['etc']['sp_limit_value'])
|
||||
->setDbBlockId($this->id)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
// insert repeat track option
|
||||
$qry = new CcBlockcriteria();
|
||||
|
@ -1294,8 +1276,7 @@ SQL;
|
|||
->setDbModifier('N/A')
|
||||
->setDbValue($p_criteriaData['etc']['sp_repeat_tracks'])
|
||||
->setDbBlockId($this->id)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
// insert overflow track option
|
||||
$qry = new CcBlockcriteria();
|
||||
|
@ -1303,8 +1284,7 @@ SQL;
|
|||
->setDbModifier('N/A')
|
||||
->setDbValue($p_criteriaData['etc']['sp_overflow_tracks'])
|
||||
->setDbBlockId($this->id)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,13 +39,11 @@ class Application_Model_Library
|
|||
$playlists = CcPlaylistQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->orderByname()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
} else {
|
||||
$playlists = CcPlaylistQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
foreach ($playlists as $playlist) {
|
||||
$playlistNames[$playlist->getDbId()] = $playlist->getDbName();
|
||||
|
|
|
@ -274,23 +274,20 @@ SQL;
|
|||
//convert "linked" files (Airtime <= 1.8.2) to watched files.
|
||||
$propel_link_dir = CcMusicDirsQuery::create()
|
||||
->filterByType('link')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
//see if any linked files exist.
|
||||
if (isset($propel_link_dir)) {
|
||||
//newly added watched directory object
|
||||
$propel_new_watch = CcMusicDirsQuery::create()
|
||||
->filterByDirectory(Application_Common_OsPath::normpath($p_path) . '/')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
//any files of the deprecated "link" type.
|
||||
$link_files = CcFilesQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->filterByDbDirectory($propel_link_dir->getId())
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$newly_watched_dir = $propel_new_watch->getDirectory();
|
||||
|
||||
|
@ -330,8 +327,7 @@ SQL;
|
|||
{
|
||||
$dir = CcMusicDirsQuery::create()
|
||||
->filterByDirectory($p_path)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if ($dir == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -350,8 +346,7 @@ SQL;
|
|||
$result = [];
|
||||
|
||||
$dirs = CcMusicDirsQuery::create()
|
||||
->filterByType('watched')
|
||||
;
|
||||
->filterByType('watched');
|
||||
if ($exists !== null) {
|
||||
$dirs = $dirs->filterByExists($exists);
|
||||
}
|
||||
|
@ -371,8 +366,7 @@ SQL;
|
|||
{
|
||||
$dir = CcMusicDirsQuery::create()
|
||||
->filterByType('stor')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
return new Application_Model_MusicDir($dir);
|
||||
}
|
||||
|
@ -412,8 +406,7 @@ SQL;
|
|||
->filterByType(['watched', 'stor'])
|
||||
->filterByExists(true)
|
||||
->filterByWatched(true)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
foreach ($dirs as $dir) {
|
||||
$directory = $dir->getDirectory();
|
||||
|
|
|
@ -465,8 +465,7 @@ SQL;
|
|||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
} else {
|
||||
//add to the end of the playlist
|
||||
if ($addType == 'after') {
|
||||
|
@ -479,16 +478,14 @@ SQL;
|
|||
$contentsToUpdate = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
}
|
||||
|
||||
$contentsToUpdate = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
}
|
||||
|
||||
foreach ($p_items as $ac) {
|
||||
|
@ -537,15 +534,13 @@ SQL;
|
|||
$contentsToMove = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbId($p_items, Criteria::IN)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$otherContent = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbId($p_items, Criteria::NOT_IN)
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$pos = 0;
|
||||
//moving items to beginning of the playlist.
|
||||
|
@ -612,13 +607,11 @@ SQL;
|
|||
$itemsToDelete = CcPlaylistcontentsQuery::create()
|
||||
->filterByPrimaryKeys($p_items)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
CcPlaylistcontentsQuery::create()
|
||||
->findPKs($p_items)
|
||||
->delete($this->con)
|
||||
;
|
||||
->delete($this->con);
|
||||
|
||||
// now that the items have been deleted we can update the
|
||||
// is_playlist flag in cc_files
|
||||
|
@ -627,8 +620,7 @@ SQL;
|
|||
$contents = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
//reset the positions of the remaining items.
|
||||
for ($i = 0; $i < count($contents); ++$i) {
|
||||
|
@ -653,8 +645,7 @@ SQL;
|
|||
->joinWith(CcFilesPeer::OM_CLASS)
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbPosition($pos)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (!$row) {
|
||||
return null;
|
||||
|
@ -770,8 +761,7 @@ SQL;
|
|||
$row = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbPosition(0)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
$this->changeFadeInfo($row->getDbId(), $fadein, null);
|
||||
}
|
||||
|
@ -780,8 +770,7 @@ SQL;
|
|||
$row = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbPosition($this->getSize() - 1)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
$this->changeFadeInfo($row->getDbId(), null, $fadeout);
|
||||
}
|
||||
|
@ -817,8 +806,7 @@ SQL;
|
|||
$row = CcPlaylistcontentsQuery::create()
|
||||
->joinWith(CcFilesPeer::OM_CLASS)
|
||||
->filterByPrimaryKey($id)
|
||||
->findOne($this->con)
|
||||
;
|
||||
->findOne($this->con);
|
||||
|
||||
if (is_null($row)) {
|
||||
throw new Exception('Playlist item does not exist.');
|
||||
|
@ -997,8 +985,7 @@ SQL;
|
|||
$itemsToDelete = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($p_ids)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$updateIsPlaylistFlag = false;
|
||||
|
||||
|
@ -1052,8 +1039,7 @@ SQL;
|
|||
$itemsToDelete = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->filterByDbFileId(null, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
|
||||
|
||||
|
@ -1139,8 +1125,7 @@ SQL;
|
|||
->join('CcFiles.CcPlaylistcontents')
|
||||
->where('CcPlaylistcontents.DbPlaylistId = ?', $this->pl->getDbId())
|
||||
->where('CcFiles.DbFileExists = ?', 'false')
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
//Nicer Propel version but slightly slower because it generates a LEFT JOIN:
|
||||
/*
|
||||
|
|
|
@ -861,15 +861,13 @@ class Application_Model_Preference
|
|||
//New versions use schema_version
|
||||
$pref = CcPrefQuery::create()
|
||||
->filterByKeystr('schema_version')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (empty($pref)) {
|
||||
//Pre-2.5.2 releases all used this ambiguous "system_version" key to represent both the code and schema versions...
|
||||
$pref = CcPrefQuery::create()
|
||||
->filterByKeystr('system_version')
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
}
|
||||
|
||||
return $pref->getValStr();
|
||||
|
|
|
@ -227,21 +227,18 @@ SQL;
|
|||
$currentMediaType = 'track';
|
||||
$currentFile = CcFilesQuery::create()
|
||||
->filterByDbId($currentMediaFileId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$currentMediaName = $currentFile->getDbArtistName() . ' - ' . $currentFile->getDbTrackTitle();
|
||||
$currentMetadata = CcFiles::sanitizeResponse($currentFile);
|
||||
} elseif (isset($currentMediaStreamId)) {
|
||||
$currentMediaType = 'webstream';
|
||||
$currentWebstream = CcWebstreamQuery::create()
|
||||
->filterByDbId($currentMediaStreamId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$currentWebstreamMetadata = CcWebstreamMetadataQuery::create()
|
||||
->filterByDbInstanceId($currentMedia['id'])
|
||||
->orderByDbStartTime(Criteria::DESC)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$currentMediaName = $currentWebstream->getDbName();
|
||||
if (isset($currentWebstreamMetadata)) {
|
||||
$currentMediaName .= ' - ' . $currentWebstreamMetadata->getDbLiquidsoapData();
|
||||
|
@ -265,8 +262,7 @@ SQL;
|
|||
->filterByDbEnds($utcNow, Criteria::LESS_THAN)
|
||||
->filterByDbPlayoutStatus(0, Criteria::GREATER_THAN)
|
||||
->orderByDbStarts(Criteria::DESC)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (isset($previousMedia)) {
|
||||
$previousMetadata = null;
|
||||
$previousMediaName = '';
|
||||
|
@ -276,8 +272,7 @@ SQL;
|
|||
$previousMediaType = 'track';
|
||||
$previousFile = CcFilesQuery::create()
|
||||
->filterByDbId($previousMediaFileId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (isset($previousFile)) {
|
||||
$previousMediaName = $previousFile->getDbArtistName() . ' - ' . $previousFile->getDbTrackTitle();
|
||||
$previousMetadata = CcFiles::sanitizeResponse($previousFile);
|
||||
|
@ -287,8 +282,7 @@ SQL;
|
|||
$previousMediaType = 'webstream';
|
||||
$previousWebstream = CcWebstreamQuery::create()
|
||||
->filterByDbId($previousMediaStreamId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$previousMediaName = $previousWebstream->getDbName();
|
||||
} else {
|
||||
$previousMediaType = null;
|
||||
|
@ -306,8 +300,7 @@ SQL;
|
|||
->filterByDbStarts($utcNow, Criteria::GREATER_THAN)
|
||||
->filterByDbPlayoutStatus(0, Criteria::GREATER_THAN)
|
||||
->orderByDbStarts(Criteria::ASC)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (isset($nextMedia)) {
|
||||
$nextMetadata = null;
|
||||
$nextMediaName = '';
|
||||
|
@ -317,16 +310,14 @@ SQL;
|
|||
$nextMediaType = 'track';
|
||||
$nextFile = CcFilesQuery::create()
|
||||
->filterByDbId($nextMediaFileId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$nextMetadata = CcFiles::sanitizeResponse($nextFile);
|
||||
$nextMediaName = $nextFile->getDbArtistName() . ' - ' . $nextFile->getDbTrackTitle();
|
||||
} elseif (isset($nextMediaStreamId)) {
|
||||
$nextMediaType = 'webstream';
|
||||
$nextWebstream = CcWebstreamQuery::create()
|
||||
->filterByDbId($nextMediaStreamId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
$nextMediaName = $nextWebstream->getDbName();
|
||||
} else {
|
||||
$nextMediaType = null;
|
||||
|
@ -1181,13 +1172,11 @@ SQL;
|
|||
$ccShowInstance = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->filterByDbStarts($show_start->format(DEFAULT_TIMESTAMP_FORMAT))
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
} elseif (!is_null($instanceId)) {
|
||||
$ccShowInstance = CcShowInstancesQuery::create()
|
||||
->filterByDbId($instanceId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
}
|
||||
if ($update && ($ccShowInstance && $ccShowInstance->getDbModifiedInstance() == true)) {
|
||||
return false;
|
||||
|
|
|
@ -58,15 +58,13 @@ final class Application_Model_Scheduler
|
|||
{
|
||||
$destinationInstanceId = $destination['instance'];
|
||||
$destinationCcShowInstance = CcShowInstancesQuery::create()
|
||||
->findPk($destinationInstanceId)
|
||||
;
|
||||
->findPk($destinationInstanceId);
|
||||
$isDestinationLinked = $destinationCcShowInstance->getCcShow()->isLinked();
|
||||
|
||||
foreach ($itemsToMove as $itemToMove) {
|
||||
$sourceInstanceId = $itemToMove['instance'];
|
||||
$ccShowInstance = CcShowInstancesQuery::create()
|
||||
->findPk($sourceInstanceId)
|
||||
;
|
||||
->findPk($sourceInstanceId);
|
||||
|
||||
//does the item being moved belong to a linked show
|
||||
$isSourceLinked = $ccShowInstance->getCcShow()->isLinked();
|
||||
|
@ -469,8 +467,7 @@ final class Application_Model_Scheduler
|
|||
->setDbCueOut('00:00:00')
|
||||
->setDbPlayoutStatus(-1)
|
||||
->setDbInstanceId($instanceId)
|
||||
->save($this->con)
|
||||
;
|
||||
->save($this->con);
|
||||
} else {
|
||||
$nextDT = $DT;
|
||||
}
|
||||
|
@ -495,8 +492,7 @@ final class Application_Model_Scheduler
|
|||
$schedule = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($instanceId)
|
||||
->orderByDbStarts()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$now = new DateTime('now', new DateTimeZone('UTC'));
|
||||
$itemStartDT = $instance->getDbStarts(null);
|
||||
|
@ -510,8 +506,7 @@ final class Application_Model_Scheduler
|
|||
}
|
||||
$item->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT)
|
||||
->save($this->con)
|
||||
;
|
||||
->save($this->con);
|
||||
$itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration);
|
||||
}
|
||||
}
|
||||
|
@ -536,8 +531,7 @@ final class Application_Model_Scheduler
|
|||
->filterByDbInstanceId($showInstance)
|
||||
->filterByDbId($exclude, Criteria::NOT_IN)
|
||||
->orderByDbStarts()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$now = new DateTime('now', new DateTimeZone('UTC'));
|
||||
$itemStartDT = $instance->getDbStarts(null);
|
||||
|
@ -551,8 +545,7 @@ final class Application_Model_Scheduler
|
|||
}
|
||||
|
||||
$item->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT)
|
||||
;
|
||||
->setDbEnds($itemEndDT);
|
||||
|
||||
$itemStartDT = $itemEndDT;
|
||||
}
|
||||
|
@ -579,8 +572,7 @@ final class Application_Model_Scheduler
|
|||
->filterByDbInstanceId($showInstance)
|
||||
->filterByDbId($exclude, Criteria::NOT_IN)
|
||||
->orderByDbStarts()
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
foreach ($schedule as $item) {
|
||||
//START OF TIME RECALC HACK
|
||||
|
@ -608,8 +600,7 @@ final class Application_Model_Scheduler
|
|||
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
|
||||
$item->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT)
|
||||
->save($this->con)
|
||||
;
|
||||
->save($this->con);
|
||||
$itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration);
|
||||
}
|
||||
|
||||
|
@ -719,13 +710,11 @@ final class Application_Model_Scheduler
|
|||
$instances = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($ccShow['id'])
|
||||
->filterByDbStarts(gmdate(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
} else {
|
||||
$instances = CcShowInstancesQuery::create()
|
||||
->filterByDbId($schedule['instance'])
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
$excludePositions = [];
|
||||
|
@ -1065,8 +1054,7 @@ final class Application_Model_Scheduler
|
|||
//update the status flag in cc_schedule.
|
||||
$instances = CcShowInstancesQuery::create()
|
||||
->filterByPrimaryKeys($affectedShowInstances)
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
$startProfile = microtime(true);
|
||||
|
||||
|
@ -1083,8 +1071,7 @@ final class Application_Model_Scheduler
|
|||
//update the last scheduled timestamp.
|
||||
CcShowInstancesQuery::create()
|
||||
->filterByPrimaryKeys($affectedShowInstances)
|
||||
->update(['DbLastScheduled' => new DateTime('now', new DateTimeZone('UTC'))], $this->con)
|
||||
;
|
||||
->update(['DbLastScheduled' => new DateTime('now', new DateTimeZone('UTC'))], $this->con);
|
||||
|
||||
$endProfile = microtime(true);
|
||||
Logging::debug('updating last scheduled timestamp.');
|
||||
|
@ -1298,8 +1285,7 @@ final class Application_Model_Scheduler
|
|||
->filterByDbPosition($removedItem->getDbPosition())
|
||||
->filterByDbInstanceId($instanceIds, Criteria::IN)
|
||||
->filterByDbId($removedItem->getDbId(), Criteria::NOT_EQUAL)
|
||||
->delete($this->con)
|
||||
;
|
||||
->delete($this->con);
|
||||
}
|
||||
|
||||
//check to truncate the currently playing item instead of deleting it.
|
||||
|
@ -1320,8 +1306,7 @@ final class Application_Model_Scheduler
|
|||
$removedItem->setDbCueOut($cueout)
|
||||
->setDbClipLength($cliplength)
|
||||
->setDbEnds($this->nowDT)
|
||||
->save($this->con)
|
||||
;
|
||||
->save($this->con);
|
||||
} else {
|
||||
$removedItem->delete($this->con);
|
||||
}
|
||||
|
@ -1338,8 +1323,7 @@ final class Application_Model_Scheduler
|
|||
//update the status flag in cc_schedule.
|
||||
$instances = CcShowInstancesQuery::create()
|
||||
->filterByPrimaryKeys($effectedInstanceIds)
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
foreach ($instances as $instance) {
|
||||
$instance->updateScheduleStatus($this->con);
|
||||
|
@ -1349,8 +1333,7 @@ final class Application_Model_Scheduler
|
|||
//update the last scheduled timestamp.
|
||||
CcShowInstancesQuery::create()
|
||||
->filterByPrimaryKeys($showInstances)
|
||||
->update(['DbLastScheduled' => new DateTime('now', new DateTimeZone('UTC'))], $this->con)
|
||||
;
|
||||
->update(['DbLastScheduled' => new DateTime('now', new DateTimeZone('UTC'))], $this->con);
|
||||
|
||||
$this->con->commit();
|
||||
|
||||
|
@ -1391,8 +1374,7 @@ final class Application_Model_Scheduler
|
|||
$items = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($p_id)
|
||||
->filterByDbEnds($this->nowDT, Criteria::GREATER_THAN)
|
||||
->find($this->con)
|
||||
;
|
||||
->find($this->con);
|
||||
|
||||
if (count($items) > 0) {
|
||||
$remove = [];
|
||||
|
|
|
@ -258,8 +258,7 @@ SQL;
|
|||
->filterByDbFirstShow($startsDT->format('Y-m-d'))
|
||||
->filterByDbStartTime($startsDT->format('H:i:s'))
|
||||
->filterByDbShowId($this->_showId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
/* Check if this cc_show_day rule is non-repeating. If it is, then
|
||||
* we know this instance was edited out of the repeating sequence
|
||||
|
@ -277,16 +276,14 @@ SQL;
|
|||
->filterByDbShowId($this->_showId)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->filterByDbId($excludeIds, criteria::NOT_IN)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
} elseif ($ccShowDay->getDbRepeatType() == -1) {
|
||||
array_push($showDayIds, $ccShowDay->getDbId());
|
||||
|
||||
//treat edited instance as separate show for resize
|
||||
$showInstances = CcShowInstancesQuery::create()
|
||||
->filterByDbId($instanceId)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
} else {
|
||||
$ccShowDays = $ccShow->getCcShowDayss();
|
||||
|
@ -296,8 +293,7 @@ SQL;
|
|||
|
||||
$showInstances = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($this->_showId)
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
}
|
||||
|
||||
/* Check two things:
|
||||
|
@ -400,8 +396,7 @@ SQL;
|
|||
$instances = CcShowInstancesQuery::create()
|
||||
->filterByDbEnds($nowDateTime->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
|
||||
->filterByDbId($instanceIds, Criteria::IN)
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
|
||||
foreach ($instances as $instance) {
|
||||
$instance->updateScheduleStatus($con);
|
||||
|
@ -423,8 +418,7 @@ SQL;
|
|||
|
||||
CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->_showId)
|
||||
->update(['DbLastShow' => $timeinfo[0]])
|
||||
;
|
||||
->update(['DbLastShow' => $timeinfo[0]]);
|
||||
|
||||
$sql = <<<'SQL'
|
||||
SELECT id from cc_show_instances
|
||||
|
@ -461,8 +455,7 @@ SQL;
|
|||
->filterByDbShowId($this->getId())
|
||||
->filterByDbRecord(1)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
return !is_null($showInstancesRow);
|
||||
}
|
||||
|
@ -480,8 +473,7 @@ SQL;
|
|||
->filterByDbShowId($this->_showId)
|
||||
->filterByDbRebroadcast(1)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
return !is_null($showInstancesRow);
|
||||
}
|
||||
|
@ -522,8 +514,7 @@ SQL;
|
|||
{
|
||||
$showDaysRow = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->_showId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (!is_null($showDaysRow)) {
|
||||
return $showDaysRow->getDbRepeatType() != -1;
|
||||
|
@ -545,8 +536,7 @@ SQL;
|
|||
{
|
||||
$showDaysRow = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->_showId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
if (!is_null($showDaysRow)) {
|
||||
return $showDaysRow->getDbRepeatType();
|
||||
|
@ -847,8 +837,7 @@ SQL;
|
|||
{
|
||||
return CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($this->getId())
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -913,8 +902,7 @@ SQL;
|
|||
);
|
||||
|
||||
return CcShowInstancesQuery::create()
|
||||
->findPk($row)
|
||||
;
|
||||
->findPk($row);
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
|
@ -1049,12 +1037,10 @@ SQL;
|
|||
$repeatInfo = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($show_id)
|
||||
->filterByDbDay($day)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
$repeatInfo->setDbNextPopDate($nextInfo[0])
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -67,8 +67,7 @@ class Application_Model_ShowBuilder
|
|||
$host_shows = CcShowHostsQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->filterByDbHost($this->user->getId())
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
foreach ($host_shows as $host_show) {
|
||||
$shows[] = $host_show->getDbShow();
|
||||
|
|
|
@ -164,24 +164,21 @@ SQL;
|
|||
public function setShowStart($start)
|
||||
{
|
||||
$this->_showInstance->setDbStarts($start)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
public function setShowEnd($end)
|
||||
{
|
||||
$this->_showInstance->setDbEnds($end)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
public function setAutoPlaylistBuilt($bool)
|
||||
{
|
||||
$this->_showInstance->setDbAutoPlaylistBuilt($bool)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
|
||||
public function updateScheduledTime()
|
||||
|
@ -314,8 +311,7 @@ SQL;
|
|||
{
|
||||
CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($this->_instanceId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
$this->updateScheduledTime();
|
||||
}
|
||||
|
@ -327,8 +323,7 @@ SQL;
|
|||
|
||||
$showDays = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
$showEnd = $showDays->getDbLastShow();
|
||||
|
||||
|
@ -351,8 +346,7 @@ SQL;
|
|||
->filterByDbShowId($showId)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->filterByDbRebroadcast(0)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
if (is_null($showInstances)) {
|
||||
return true;
|
||||
|
@ -363,8 +357,7 @@ SQL;
|
|||
|
||||
$showDaysOld = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$tz = $showDaysOld[0]->getDbTimezone();
|
||||
|
||||
|
@ -392,8 +385,7 @@ SQL;
|
|||
$showInstances = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($showId)
|
||||
->filterByDbModifiedInstance(true)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -415,8 +407,7 @@ SQL;
|
|||
CcShowInstancesQuery::create()
|
||||
->findPK($this->_instanceId)
|
||||
->setDbModifiedInstance(true)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
if ($this->isRebroadcast()) {
|
||||
return;
|
||||
|
@ -426,21 +417,18 @@ SQL;
|
|||
if ($recording) {
|
||||
CcShowInstancesQuery::create()
|
||||
->filterByDbOriginalShow($this->_instanceId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
|
||||
// Automatically delete all files scheduled in cc_schedules table.
|
||||
CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($this->_instanceId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
|
||||
if ($this->checkToDeleteShow($showId)) {
|
||||
CcShowQuery::create()
|
||||
->filterByDbId($showId)
|
||||
->delete()
|
||||
;
|
||||
->delete();
|
||||
}
|
||||
} else {
|
||||
if ($this->isRebroadcast()) {
|
||||
|
@ -459,16 +447,13 @@ SQL;
|
|||
public function setRecordedFile($file_id)
|
||||
{
|
||||
$showInstance = CcShowInstancesQuery::create()
|
||||
->findPK($this->_instanceId)
|
||||
;
|
||||
->findPK($this->_instanceId);
|
||||
$showInstance->setDbRecordedFile($file_id)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
|
||||
$rebroadcasts = CcShowInstancesQuery::create()
|
||||
->filterByDbOriginalShow($this->_instanceId)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
foreach ($rebroadcasts as $rebroadcast) {
|
||||
try {
|
||||
|
@ -611,8 +596,7 @@ SQL;
|
|||
->filterByDbStarts($p_start->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
|
||||
->leftJoinCcShow()
|
||||
->where('CcShow.has_autoplaylist = ?', 'true')
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
$hasAutoplaylist = [];
|
||||
foreach ($showInstances->toArray() as $ap) {
|
||||
$hasAutoplaylist[$ap['DbId']] = true;
|
||||
|
|
|
@ -194,8 +194,7 @@ class Application_Model_StoredFile
|
|||
} // get the user by id and set it like that
|
||||
else {
|
||||
$user = CcSubjsQuery::create()
|
||||
->findPk($p_md['owner_id'])
|
||||
;
|
||||
->findPk($p_md['owner_id']);
|
||||
if ($user) {
|
||||
$owner = $user;
|
||||
}
|
||||
|
@ -661,8 +660,7 @@ SQL;
|
|||
$file = CcFilesQuery::create()
|
||||
->filterByDbDirectory($music_dir->getId())
|
||||
->filterByDbFilepath($path_info[1])
|
||||
->findOne($con)
|
||||
;
|
||||
->findOne($con);
|
||||
|
||||
return is_null($file) ? null : self::createWithFile($file, $con);
|
||||
}
|
||||
|
@ -679,8 +677,7 @@ SQL;
|
|||
$files = CcFilesQuery::create()
|
||||
->filterByDbDirectory($music_dir->getId())
|
||||
->filterByDbFilepath("{$path_info[1]}%")
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
$res = [];
|
||||
foreach ($files as $file) {
|
||||
$storedFile = new Application_Model_StoredFile($file, $con);
|
||||
|
@ -1142,15 +1139,13 @@ SQL;
|
|||
public function setFileExistsFlag($flag)
|
||||
{
|
||||
$this->_file->setDbFileExists($flag)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
|
||||
public function setFileHiddenFlag($flag)
|
||||
{
|
||||
$this->_file->setDbHidden($flag)
|
||||
->save()
|
||||
;
|
||||
->save();
|
||||
}
|
||||
|
||||
// This method seems to be unsued everywhere so I've commented it out
|
||||
|
|
|
@ -121,8 +121,7 @@ class Application_Model_StreamSetting
|
|||
{
|
||||
$rows = CcStreamSettingQuery::create()
|
||||
->filterByDbKeyName("{$p_streamId}_%")
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
//This is way too much code because someone made only stupid decisions about how
|
||||
//the layout of this table worked. The git history doesn't lie.
|
||||
|
|
|
@ -460,8 +460,7 @@ class CcFiles extends BaseCcFiles
|
|||
$defaultOwner = CcSubjsQuery::create()
|
||||
->filterByDbType('A')
|
||||
->orderByDbId()
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
if (!$defaultOwner) {
|
||||
// what to do if there is no admin user?
|
||||
// should we handle this case?
|
||||
|
|
|
@ -23,8 +23,7 @@ class CcShow extends BaseCcShow
|
|||
return CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->id)
|
||||
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,8 +56,7 @@ class CcShow extends BaseCcShow
|
|||
->filterByCcShow($this)
|
||||
->orderByDbFirstShow()
|
||||
->limit(1)
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
return $collCcShowDayss;
|
||||
}
|
||||
|
@ -84,8 +82,7 @@ class CcShow extends BaseCcShow
|
|||
->filterByDbShowId($this->id)
|
||||
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
|
||||
->orderByDbFirstShow()
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,8 +98,7 @@ class CcShow extends BaseCcShow
|
|||
$ccShowDays = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->id)
|
||||
->filterByDbRepeatType(0, Criteria::GREATER_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
if (!$ccShowDays->isEmpty()) {
|
||||
return true;
|
||||
|
@ -121,8 +117,7 @@ class CcShow extends BaseCcShow
|
|||
$ccShowDays = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->id)
|
||||
->filterByDbRepeatType(-1)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$startsUTC = [];
|
||||
|
||||
|
@ -140,8 +135,7 @@ class CcShow extends BaseCcShow
|
|||
$excludeInstances = CcShowInstancesQuery::create()
|
||||
->filterByDbShowId($this->id)
|
||||
->filterByDbStarts($startsUTC, criteria::IN)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$excludeIds = [];
|
||||
foreach ($excludeInstances as $instance) {
|
||||
|
@ -178,8 +172,7 @@ class CcShow extends BaseCcShow
|
|||
->filterByCcShow($this)
|
||||
->filterByDbStarts(gmdate('Y-m-d H:i:s'), Criteria::GREATER_THAN)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
return $collCcShowInstancess;
|
||||
}
|
||||
|
@ -195,8 +188,7 @@ class CcShow extends BaseCcShow
|
|||
$ccShowDay = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->getDbId())
|
||||
->filterByDbRecord(1)
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
return !is_null($ccShowDay);
|
||||
}
|
||||
|
@ -205,8 +197,7 @@ class CcShow extends BaseCcShow
|
|||
{
|
||||
$ccShowRebroadcast = CcShowRebroadcastQuery::create()
|
||||
->filterByDbShowId($this->getDbId())
|
||||
->findOne()
|
||||
;
|
||||
->findOne();
|
||||
|
||||
return !is_null($ccShowRebroadcast);
|
||||
}
|
||||
|
@ -216,8 +207,7 @@ class CcShow extends BaseCcShow
|
|||
return CcShowRebroadcastQuery::create()
|
||||
->filterByDbShowId($this->getDbId())
|
||||
->orderByDbDayOffset()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
public function getRebroadcastsAbsolute()
|
||||
|
@ -227,8 +217,7 @@ class CcShow extends BaseCcShow
|
|||
->filterByDbRebroadcast(1)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->orderByDbStarts()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
public function isLinked()
|
||||
|
@ -263,8 +252,7 @@ class CcShow extends BaseCcShow
|
|||
->filterByCcShow($this)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->orderByDbId()
|
||||
->find($con)
|
||||
;
|
||||
->find($con);
|
||||
|
||||
/*if(null === $this->collCcShowInstancess || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcShowInstancess) {
|
||||
|
@ -319,8 +307,7 @@ class CcShow extends BaseCcShow
|
|||
return CcShowInstancesQuery::create()
|
||||
->filterByCcShow($this)
|
||||
->filterByDbId($instanceId, Criteria::NOT_EQUAL)
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
}
|
||||
|
||||
public function getShowInfo()
|
||||
|
|
|
@ -118,8 +118,7 @@ class CcShowInstances extends BaseCcShowInstances
|
|||
->filterByDbInstanceId($this->id)
|
||||
->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL)
|
||||
->filterByDbEnds($this->ends, Criteria::LESS_EQUAL)
|
||||
->update(['DbPlayoutStatus' => 1], $con)
|
||||
;
|
||||
->update(['DbPlayoutStatus' => 1], $con);
|
||||
|
||||
//scheduled track is a boundary track
|
||||
CcScheduleQuery::create()
|
||||
|
@ -127,16 +126,14 @@ class CcShowInstances extends BaseCcShowInstances
|
|||
->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL)
|
||||
->filterByDbStarts($this->ends, Criteria::LESS_THAN)
|
||||
->filterByDbEnds($this->ends, Criteria::GREATER_THAN)
|
||||
->update(['DbPlayoutStatus' => 2], $con)
|
||||
;
|
||||
->update(['DbPlayoutStatus' => 2], $con);
|
||||
|
||||
//scheduled track is overbooked.
|
||||
CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($this->id)
|
||||
->filterByDbPlayoutStatus(0, Criteria::GREATER_EQUAL)
|
||||
->filterByDbStarts($this->ends, Criteria::GREATER_THAN)
|
||||
->update(['DbPlayoutStatus' => 0], $con)
|
||||
;
|
||||
->update(['DbPlayoutStatus' => 0], $con);
|
||||
|
||||
$this->setDbLastScheduled(gmdate('Y-m-d H:i:s'));
|
||||
$this->save($con);
|
||||
|
@ -155,8 +152,7 @@ class CcShowInstances extends BaseCcShowInstances
|
|||
$schedule = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($this->id)
|
||||
->orderByDbStarts()
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
|
||||
$pos = 0;
|
||||
foreach ($schedule as $item) {
|
||||
|
|
|
@ -30,8 +30,7 @@ class CcSubjs extends BaseCcSubjs
|
|||
public function isHostOfShowInstance($instanceId)
|
||||
{
|
||||
$showInstance = CcShowInstancesQuery::create()
|
||||
->findPk($instanceId)
|
||||
;
|
||||
->findPk($instanceId);
|
||||
|
||||
return CcShowHostsQuery::create()
|
||||
->filterByDbShow($showInstance->getDbShowId())
|
||||
|
|
|
@ -22,8 +22,7 @@ class StationPodcast extends BaseStationPodcast
|
|||
{
|
||||
$episodes = PodcastEpisodesQuery::create()
|
||||
->filterByDbPodcastId($this->getDbPodcastId())
|
||||
->find()
|
||||
;
|
||||
->find();
|
||||
foreach ($episodes as $e) {
|
||||
if ($e->getDbFileId() == $fileId) {
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue