? 439170.patch
Index: video_upload.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/video_upload/video_upload.module,v
retrieving revision 1.23.2.7.2.12
diff -u -p -r1.23.2.7.2.12 video_upload.module
--- video_upload.module	3 Oct 2010 15:30:25 -0000	1.23.2.7.2.12
+++ video_upload.module	3 Oct 2010 16:03:16 -0000
@@ -409,11 +409,23 @@ function video_upload_field($op, $node, 
         return;
       }
 
-      // Delete items from original node.
-      $orig = node_load($node->nid);
-      // If there are, figure out which ones must go.
-      if (!empty($orig->$field['field_name'])) {
-        foreach ($orig->$field['field_name'] as $oitem) {
+      $original_node = node_load($node->nid);
+
+      // If the node values that sync with the external video have changed, update the
+      // video status so that next time cron runs the updates are picked up.
+      $changed = ($node->title != $original_node->title || $node->body != $original_node->body);
+      if ($op == 'update' && $changed) {
+        foreach ($items as $key => $item) {
+          // We should only be updating videos that are synced or we could cause trouble
+          if ($items[$key]['video_status'] == VIDEO_UPLOAD_STATUS_OK_SYNCED) {
+            $items[$key]['video_status'] = VIDEO_UPLOAD_STATUS_OK;
+          }
+        }
+      }
+
+      // Delete items from original node if any. Figure out which ones must go
+      if (!empty($original_node->$field['field_name'])) {
+        foreach ($original_node->$field['field_name'] as $oitem) {
           if (isset($oitem['fid']) && !in_array($oitem['fid'], $curfids)) {
             // For hook_file_references, remember that this is being deleted.
             $oitem['field_name'] = $field['field_name'];
