You are here

public function video_phpvideotoolkit::delete_job in Video 7

Interface Implementations

Overrides transcoder_interface::delete_job

See also

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

File

transcoders/video_phpvideotoolkit.inc, line 474

Class

video_phpvideotoolkit

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_files')
    ->condition('fid', $video->fid)
    ->execute();
}