You are here

private static function video_jobs::setCompletedOrFailed in Video 7.2

2 calls to video_jobs::setCompletedOrFailed()
video_jobs::setCompleted in includes/jobs.inc
video_jobs::setFailed in includes/jobs.inc

File

includes/jobs.inc, line 93
Static class containing transcoding job related operations.

Class

video_jobs
@file Static class containing transcoding job related operations.

Code

private static function setCompletedOrFailed(stdClass $video, $newstatus, $rulesevent) {

  // Check if the status is already set right to prevent double events.
  if ($video->video_status == $newstatus) {
    return;
  }
  $video->video_status = $newstatus;
  $video->completed = $video->statusupdated = time();
  self::update($video);

  // Clear the cache for the associated entity
  video_utility::clearEntityCache($video->entity_type, $video->entity_id);

  // Invoke Rules
  if (module_exists('rules') && $video->entity_type == 'node') {
    rules_invoke_event($rulesevent, node_load($video->entity_id));
  }
}