update youtube video if node is updated
kepesv - April 20, 2009 - 13:46
| Project: | Video Upload |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Justin W Freeman |
| Status: | needs review |
Description
I've created a node with a video. The cron job uploaded it to YouTube correctly.
But... If I edit the node and change the video file (delete the existing and upload a new) or node title (=video title) youtube doesn't follow this changes because the module doesn't hit the cron to do it.
Are you plan to solve this problem?
Anyway I like this module, it's great work!! respect :)

#1
I saw this message after I tried to update the title/body of the successful uploaded video node.
Referencing to the file used in the Myvideofile field is not allowed.But I can change the Video Title & Description of the successful uploaded video from Youtube, it didn't sync back to the title/body of the original video node.
It seems that there's no sync between the Video node of Drupal and Video in the Youtube. Looks like I have to check the setting very carefully and thoroughly!
Also, the video in the drupal files directory will not be erased after the successful upload, is this true?
#2
For updating the video node................
After checking the setting of the video field, I did set the following three to Synchronize (overwrite default)
1) Default Video Title Synchronization
2) Default Video Description Synchronization
3) Default Video Keyword Synchronization
However, I can not update the title/description of the video, nor delete the video node. Any clue??
Thanks in advance.
#3
Just curious....Does the Video Upload really support title/body field and video modify/update and sync between Drupal and Youtube after the video node had been created and original video uploaded to the Youtube???
Anyone has the answer?? Thanks again.
#4
@happydrupal, this should all theoretically work, but I've never deployed this module to a site where the actual video file changes on a node. What would actually happen in this case is that the module would delete the old video from youtube, and upload the new one. Since this may be undesireable, I haven't spent a lot of time working on that functionality. Changes to the title and body are more straightforward and should work. I'll look into this the next chance I get to work on this module (or will gladly commit patches addressing this issue).
#5
dear jhedstrom, looking forward to your patch. Let me know if you want ot test the upload on my site, thanks.
#6
The _video_upload_update_all_videos function checks for all files that have VIDEO_UPLOAD_STATUS_OK but there doesn't seem to be anywhere in the module where the status is set to VIDEO_UPLOAD_STATUS_OK so these updates would never run.
Is this correct?
Shouldn't there be a hook_nodeapi or something that checks if these fields have been altered and if they have, updates the status so that when cron runs these updates are done?
Unless I misunderstand the way it is working this update functionality doesn't look like it would work at all.
#7
I am looking at making a patch that changes video_upload_field so that it updates the status if the other fields change.
#8
#9
Here is a patch that checks the title and body fields for changes when a node is updated and sets the video status accordingly.
Cron will then pick up the changes when it next runs.
You will want to apply the patch in #611380: Call to undefined function _video_upload_node_set_video_status() in video_upload.admin.inc on line 421
when you apply this patch or you will get that error when cron runs the updates.
#10
Found a slight problem with the patch in #9
Here is a better one.