You are here

public function video_zencoder::delete_job in Video 6.4

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

Overrides transcoder_interface::delete_job

File

plugins/video_zencoder/transcoders/video_zencoder.inc, line 287

Class

video_zencoder

Code

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

  //lets get all our videos and unlink them
  $sql = db_query("SELECT vid FROM {video_zencoder} WHERE fid=%d", $video->fid);

  //we loop here as future development will include multiple video types (HTML 5)
  while ($row = db_fetch_object($sql)) {

    // @TODO : cancel the job to transcode
  }

  //now delete our rows.
  db_query('DELETE FROM {video_zencoder} WHERE fid = %d', $video->fid);
}