You are here

public function video_zencoder::delete_job in Video 7

Same name and namespace in other branches
  1. 6.5 plugins/video_zencoder/transcoders/video_zencoder.inc \video_zencoder::delete_job()
  2. 6.4 plugins/video_zencoder/transcoders/video_zencoder.inc \video_zencoder::delete_job()

Interface Implementations

Overrides transcoder_interface::delete_job

See also

sites/all/modules/video/includes/transcoder_interface#delete_job()

File

modules/video_zencoder/transcoders/video_zencoder.inc, line 298

Class

video_zencoder

Code

public function delete_job($video) {
  $video = (object) $video;
  if (!($video = $this
    ->load_job($video->fid))) {
    return;
  }

  // converted output values
  $converted = unserialize($video->data);
  if (!empty($converted)) {
    foreach ($converted as $file) {
      if (file_exists(drupal_realpath($file->uri))) {
        @drupal_unlink($file->uri);
      }
    }
  }

  //now delete our rows.
  db_delete('video_zencoder')
    ->condition('fid', $video->fid)
    ->execute();
}