Closed (fixed)
Project:
Media: YouTube
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Jul 2011 at 18:06 UTC
Updated:
27 Mar 2012 at 16:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
dave reidComment #2
aaron commentedworks great!
Comment #3
aaron commentedand committed. thanks! btw, i added you as a maintainer to this module, Dave.
Comment #5
ksenzeeThis is broken for users of media 1.x, where file_uri_to_object() doesn't reuse existing file objects by default. I'm not sure if media_youtube is still willing to support media 1.x, but if so, here's a patch. Note that this patch also sets the file object's timestamp to the request time, so that when someone reuploads a video, it shows up as the newest media item at the top of the admin list.
Comment #6
mpotter commentedIn #5 you refer to "$file_obj->timestamp". Shouldn't this be "$file->timestamp" ??
Comment #7
aaron commentedgot that with mpotter's additional fix. Thanks guys.
Comment #8
nikosnikos commentedI know this is fixed but actually I think there's no need to override the
save()method in MediaInternetYouTubeHandler :file_save()function called just after that.save()method (fromMediaInternetHandler) call apreSave()method that have to be overriden in children to do additional operations, before the file has been savedMediaInternetYouTubeHandler :
MediaInternetHandler :
file_save :
Comment #9
aaron commentedGood points. However, file_save only adds a timestamp if not already present; we're actually potentially altering an already existing timestamp. But overriding ->presave would certainly simplify the code.
Comment #10
aaron commentedOh, whoops, I stand corrected. I missed your last snippet.
Comment #11
nikosnikos commented;) Here's a patch for #8
Comment #12
ttjordan81 commentedHere is the combination of the two patches... #1 and #5. Anyone still using alpha 5...
Comment #13
aaron commentedThis should be tested against both branches of the media module.
Comment #14
nikosnikos commentedActually ans as I said in #8 there's no need to override the save() method in MediaInternetYouTubeHandler
The patch in #11 should work and allow to reuse youtube videos without overriding save() method.
Comment #15
ddyrr commentedfor alpha5, according to #14
Comment #16
dave reidOk so I think this is what needs to be committed to 7.x-1.x still. Will test manually today.
Comment #17
dave reidTested and committed #16 to Git: http://drupalcode.org/project/media_youtube.git/commit/989be74