I noticed that everytime I edit the already uploaded content, the video disappears as it would have never been uploaded. Cron run brings it back but it also uploads the video again to youtube and causes duplicate videos.

Comments

chemicalroman’s picture

Same problem. Every time I edit one node that has a video, when i save that node, the video gets uploaded again causing duplicates in Youtube.

ddyrr’s picture

Status: Active » Needs review

I wasn't able to get beta2 through git, so I had trouble making the usual patch, but I was able to fix the problem by replacing lines 152 to 163 of video_upload.field.inc with the following:

$status = VIDEO_UPLOAD_STATUS_UPLOAD_PENDING;
if (isset($element['#default_value']['video_id']) && $element['#default_value']['video_id']) {
  $connection = video_upload_connect(TRUE);
  //@todo abstract out youtube
  $status = _video_upload_youtube_get_status_by_id($element['#default_value']['video_id'], $connection);
}

$element['video_status'] = array(
  '#type' => 'hidden',
  '#default_value' => isset($element['#default_value']['video_status']) ? $element['#default_value']['video_status'] : $status,
);
$element['video_status_ts'] = array(
  '#type' => 'hidden',
  '#default_value' => isset($element['#default_value']['video_status_ts']) ? $element['#default_value']['video_status_ts'] : REQUEST_TIME,
);
$element['video_id'] = array(
  '#type' => 'hidden',
  '#default_value' => isset($element['#default_value']['video_id']) ? $element['#default_value']['video_id'] : '',
);

I fixed two problems here. One is that the status was not being updated if it has now finished uploading (it was stuck on 'unknown'), and the default values were being set to empty values, because it was grabbing the wrong data.

ak’s picture

The fix in #2 worked for me, thx!