Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cronjobs/opencast_sync_acls.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,23 @@ public function execute($last_result, $parameters = array())
// check if video exists in Stud.IP
$video = Videos::findByEpisode($event->identifier);

// In case, the video is not yet discovered by the discovery worker!
if (empty($video)) {
echo " [Skipped] No local video record found, skipping: {$event->identifier}\n";
continue;
}

$video->created = date('Y-m-d H:i:s', strtotime($event->created));
$video->store();

if ($video->config_id != $config->id) {
echo 'config id mismatch for Video with id: '. $video->id .", $config->id <> {$video->config_id}\n";
echo ' [Skipped] config id mismatch for Video with id: '. $video->id .", $config->id <> {$video->config_id}\n";
continue;
}

Videos::checkEventACL(null, $event, $video);

echo " ACL sync successful for Video ID {$video->id} (Event ID: {$event->identifier}).\n";
}
}
} while (!empty($oc_events));
Expand Down