Index: mm_content.module
===================================================================
--- mm_content.module	(revision 218)
+++ mm_content.module	(working copy)
@@ -9,7 +9,8 @@
  */
 
 define(MM_CONTENT_HARVEST, 1);
-define(MM_CONTENT_STORE, 2);
+define(MM_CONTENT_STORE, 2);
+define(MM_CONTENT_COMPLETE, 3);
 
 /**
  * Implementation of media_mover hook
@@ -28,16 +29,18 @@
       case 'actions':
         return array(
           'harvest' => array(MM_CONTENT_HARVEST => t('Harvest from a CCK field')),
-          'storage' => array(MM_CONTENT_STORE => t('Save data in a CCK field')),
+          'storage' => array(MM_CONTENT_STORE => t('Save data in a CCK field')),
+          'complete' => array(MM_CONTENT_COMPLETE => t('Save data in a CCK field')),
         );
 
       case 'config':
         switch ($action) {
           case MM_CONTENT_HARVEST:
             return mm_content_config_harvest($action, $configuration);
-
-          case MM_CONTENT_STORE:
-            return mm_content_config_save_node($action, $configuration);
+
+          case MM_CONTENT_STORE:
+          case MM_CONTENT_COMPLETE:
+            return mm_content_config_save_node($action, $configuration, $action);
         }
         break;
 
@@ -48,14 +51,20 @@
         }
         break;
 
-      case 'storage':
+      case 'storage':
+        if ($action == MM_CONTENT_STORE) {
+          return mm_content_node_save($file, $configuration);
+        }
+        break;
+
+      case 'complete':
+        if ($action == MM_CONTENT_COMPLETE) {
+          return mm_content_node_save($file, $configuration);
+        }
+        break;
+
+        case 'delete':
         if ($action == MM_CONTENT_STORE) {
-          return mm_content_node_save($file, $configuration);
-        }
-        break;
-
-      case 'delete':
-        if ($action == MM_CONTENT_STORE) {
           // @TODO: check action that is being deleted and remove single files based on config
           
         }
@@ -96,18 +105,18 @@
  * so that they are processed correctly on the add configuration
  * screen
  */
-function mm_content_config_save_node($action, $configuration) {
+function mm_content_config_save_node($action, $configuration, $action) {
   $form = array();
-  $form['mm_harvest_conf'] = array(
+  $form['mm_save_conf'] = array(
     '#type' => 'fieldset',
-    '#title' => t('Harvest Configuration'),
+    '#title' => t('Save Configuration'),
     '#description' => t('This module saves data to a CCK field'),
     '#collapsed' => false,
-    '#attributes' => array('id' => 'mm_content--'. MM_CONTENT_STORE, 'class' => 'mm_config_option'),
+    '#attributes' => array('id' => 'mm_content--'. $action, 'class' => 'mm_config_option'),
   );
-  $form['mm_harvest_conf']["mm_config_save_field"] = array(
+  $form['mm_save_conf']["mm_config_save_field"] = array(
     '#type' => 'select',
-    '#multiple' => true,
+    '#multiple' => false,
     '#title' => t('Save the file to this CCK field'),
     '#description' => t('Select the CCK field to save files to.'),
     '#options' => _mm_content_fields(),
@@ -147,10 +156,23 @@
  * Save to the CCK field
  */
 function mm_content_node_save($file, $configuration) {
-  // @TODO:
+  // @TODO:
   $fields = content_fields();
   $field_name = $configuration['mm_config_save_field'];
-  $db_info = content_database_info($fields[$field_name]);
+
+  // Patched for blip.tv module
+  if (isset($file['bliptv_id'])) {
+    $node = node_load($file['nid']);
+    
+    $remote_video_field = &$node->$field_name;
+    if ($file['bliptv_id'] != $remote_video_field[0]['value']) {
+      $remote_video_field[0]['embed'] = $file['url'];
+      $remote_video_field[0]['value'] = $file['bliptv_id'];
+      $remote_video_field[0]['provider'] = 'bliptv';
+      node_validate($node);
+      node_save($node);
+    }
+  }  
 }
 
 /**
