You are here

function video_update in Video 6.2

Same name and namespace in other branches
  1. 5 video.module \video_update()
  2. 6 video.module \video_update()

Hook

Return value

TRUE on success, FALSE on error

File

./video.module, line 900
video.module

Code

function video_update($node) {
  if ($node->revision) {

    //If a new node revision is being added then insert a new row.
    return video_insert($node);
  }
  else {

    // set the required properties of the video node

    //video_presave($node);

    // GMM: make sure to save the encoded_fid
    if (!isset($node->serial_data['video_encoded_fid']) && $node->video_encoded_fid) {
      $node->serial_data['video_encoded_fid'] = $node->video_encoded_fid;
    }
    $node->serialized_data = serialize($node->serial_data);

    //Serialize the data for insertion into the database.
    return db_query("UPDATE {video} SET vidfile='%s', size=%d, videox=%d, videoy=%d, video_bitrate=%d, audio_bitrate=%d, audio_sampling_rate=%d, audio_channels='%s', playtime_seconds=%d, disable_multidownload=%d, download_folder='%s', use_play_folder=%d, serialized_data='%s' WHERE vid = %d", $node->vidfile, $node->size, $node->videox, $node->videoy, $node->video_bitrate, $node->audio_bitrate, $node->audio_sampling_rate, $node->audio_channels, $node->playtime_seconds, $node->disable_multidownload, $node->download_folder, $node->use_play_folder, $node->serialized_data, $node->vid);
  }
}