On the one hand, we want to keep the core media module lightweight, and not dealing with any fields on media entities other than the base file. On the other hand, media_internet.module is all about populating media entities from 3rd party media sites. Many of those sites provide meta information about the media via REST calls that return MRSS or oEmbed formatted data. Here's an initial pass at media_internet.module populating title and description fields from this information, if the media entity has those fields and if the provider provides the information. It's possible that this doesn't belong here, and instead maybe it belongs in a new media_mrss.module or media_meta.module or something like that. But we don't have those modules yet, so this seems useful in the meantime.
As said in the patch's todo, this doesn't really weigh down performance, since it's code that only runs during media_internet_add_submit().
| Comment | File | Size | Author |
|---|---|---|---|
| media_internet-auto-field-population.patch | 4.65 KB | effulgentsia |
Comments
Comment #1
JacobSingh commentedI fundamentally uneasy w/ the approach here. The patch is good though. What happened to the media_browser_plus module? Wouldn't this be the place this type of mapping occurs since it enforces certain fields? I like having the MRSS stuff in media_internet being a middle tier between media_youtube and actually saving the fields. But media_internet knowing about the fields it isn't creating is as you saying a slippery slope...
Comment #2
effulgentsia commentedYou're right. I moved the code into media_browser_plus, a new project that will be added to d.o. next week.