Adding the following to the module will expose it to feeds mapper so videos can be imported directly:

function video_filter_field_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
  foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
    $info = field_info_field($name);
    if ($info['type'] == 'video_filter') {
      if (array_key_exists('url', $info['columns'])) {
        $targets[$name . ':url'] = array(
          'name' => t('@name URL', array('@name' => $instance['label'])),
          'callback' => 'link_feeds_set_target',
          'description' => t('The @label field of the node.', array('@label' => $instance['label'])),
        );
      }
    }
  }
}

function video_filter_field_feeds_set_target($source, $entity, $target, $value) {
  if (empty($value)) {
    return;
  }

  // Handle non-multiple value fields.
  if (!is_array($value)) {
    $value = array($value);
  }

  // Iterate over all values.
  $i = 0;
  $info = field_info_field($target);
  list($field_name, $sub_field) = explode(':', $target);
  foreach ($value as $v) {
    if (!is_array($v) && !is_object($v)) {
      if (strstr($target, 'url')) {
        $field['und'][$i]['url'] = $v;
      }
    }
    if ($info['cardinality'] == 1) {
      break;
    }
    $i++;
  }
  $entity->{$field_name} = $field;
}

Comments

davidcsonka’s picture

Do you know if it would be possible to expose the field to the Rules framework also?

7wonders’s picture

Yes, it can be done through entity api - http://drupal.org/node/878880

davidcsonka’s picture

That's encouraging!

I guess I'll have to figure out how to do that, lol

spanac’s picture

@7wonders: Thank you