You are here

public function video_localcommand::get_original_path_by_converted_path in Video 6.5

Implementation of get_original_path_by_converted_path().

Overrides video_transcoder::get_original_path_by_converted_path

File

transcoders/video_localcommand.inc, line 696

Class

video_localcommand

Code

public function get_original_path_by_converted_path($filepath) {

  // This is ugly, but there is no other way
  $videos = db_query('SELECT fid, data FROM {video_files} WHERE status = %d AND data LIKE "%%%s%%"', VIDEO_RENDERING_COMPLETE, $filepath);
  $fid = NULL;
  while ($video = db_fetch_object($videos)) {
    foreach (unserialize($video->data) as $file) {
      if ($file->filepath == $filepath) {
        $fid = $video->fid;
        break 2;
      }
    }
  }
  if ($fid == NULL) {
    return NULL;
  }
  return $this
    ->load_job($fid);
}