Skip to content

Commit

Permalink
Merge pull request #547 from dasgarner/release18
Browse files Browse the repository at this point in the history
Post release fix for required files.
  • Loading branch information
dasgarner committed Apr 23, 2019
2 parents 0a02e70 + a5ae2b4 commit effd287
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions lib/Xmds/Soap.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ protected function doRequiredFiles($serverKey, $hardwareKey, $httpDownloads)

// Build up the other layouts into an array
foreach ($sth->fetchAll() as $row) {
$layouts[] = $this->getSanitizer()->int($row['layoutID']);
$layouts[] = $this->getSanitizer()->int($row['layoutId']);
}

// Also look at the schedule
Expand Down Expand Up @@ -394,10 +394,9 @@ protected function doRequiredFiles($serverKey, $hardwareKey, $httpDownloads)

$this->getLog()->debug(count($scheduleEvents) . ' events for eventId ' . $schedule->eventId);

$eventTypeId = $row['eventTypeId'];

if ($eventTypeId == Schedule::$LAYOUT_EVENT || $eventTypeId == Schedule::$OVERLAY_EVENT) {
$layouts[] = $row['layoutId'];
$layoutId = $this->getSanitizer()->int($row['layoutId']);
if ($layoutId != null && ($schedule->eventTypeId == Schedule::$LAYOUT_EVENT || $schedule->eventTypeId == Schedule::$OVERLAY_EVENT)) {
$layouts[] = $layoutId;
}
}

Expand Down Expand Up @@ -465,21 +464,29 @@ protected function doRequiredFiles($serverKey, $hardwareKey, $httpDownloads)
)
";

$params = ['displayId' => $this->display->displayId];

if ($playerVersionMediaId != null) {
$SQL .= " UNION ALL
SELECT 5 AS DownloadOrder, storedAs AS path, media.mediaId AS id, media.`MD5`, media.fileSize
FROM `media`
WHERE `media`.type = 'playersoftware'
AND `media`.mediaId = %d
AND `media`.mediaId = :playerVersionMediaId
";
$params['playerVersionMediaId'] = $playerVersionMediaId;
}

$SQL .= " ORDER BY DownloadOrder ";

$sth = $dbh->prepare(sprintf($SQL, $layoutIdList, $layoutIdList, $playerVersionMediaId));
$sth->execute(array(
'displayId' => $this->display->displayId
));
// Sub layoutId list
$SQL = sprintf($SQL, $layoutIdList, $layoutIdList);

if ($this->display->isAuditing()) {
$this->getLog()->sql($SQL, $params);
}

$sth = $dbh->prepare($SQL);
$sth->execute($params);

// Prepare a SQL statement in case we need to update the MD5 and FileSize on media nodes.
$mediaSth = $dbh->prepare('UPDATE media SET `MD5` = :md5, FileSize = :size WHERE MediaID = :mediaid');
Expand Down

0 comments on commit effd287

Please sign in to comment.