Problem/Motivation
In #2756745: [Docs] Make media name optional and let media type plugins provide the default Media entity added support for default media name on type plugins. There is default implementation in the base class, but it would make sense to provide better defaults.
See #2762099: Provide default value for entity label, if needed. for example implementation in Image plugin.
Proposed resolution
Use video title as default.
| Comment | File | Size | Author |
|---|---|---|---|
| #47 | 2762219-47-BC-BREAK-name-on-interface.patch | 7.13 KB | sam152 |
| #42 | 2762219-39-BC-BREAK-name-on-interface.patch | 0 bytes | sam152 |
| #37 | 2762219-37-BC-BREAK-name-on-interface.patch | 6.09 KB | sam152 |
| #32 | 2762219-32-BC-BREAK-name-on-interface.patch | 5.47 KB | sam152 |
| #15 | 2762219-15-BC-BREAK-name-on-interface.patch | 4.82 KB | sam152 |
Comments
Comment #2
sam152 commentedI'll have a look into this. The biggest issue will be coming up with an automatic title from the available information. We don't have access to a video title based on the interface. The two bits of info we have that might be useful are the ID and the name of the provider. I'm thinking {{ provider }}: {{ id }} might work. This would produce titles like "YouTube: XgYu7-DQjDQ".
Comment #3
slashrsm commentedCould we get title from the API (if available) and fall back to {{ provider }}: {{ id }} if it is not?
Comment #4
sam152 commentedWe would want to do it generically. Perhaps introduce a NamedVideoProviderInterface so that each provider has the chance to provide a name, then fall back to provider: id. I'll have a look at it, this week.
Comment #5
sam152 commentedPart one, a default name in the media plugin. I know vimeo has a public oembed endpoint, but I'm not sure if the same is true for youtube. In any case, this makes it a bit nicer then the UUID.
Comment #6
sam152 commentedComment #8
sam152 commentedAn API based option for the Vimeo provider without breaking BC.
Comment #9
benjy commentedIf this extends your existing interface then you'll only need to implement this one interface on the base class.
Comment #10
sam152 commentedFixed vimeo test.
Comment #11
sam152 commentedCleaned up some of the code and moved the { provider }: { id } logic into the plugin base. I believe this retains BC but I'm questioning if we actually have to. In every plugin I've encountered, it extends our base. Perhaps a BC break and a change record is enough?
Comment #12
sam152 commentedComment #13
sam152 commentedFull patch.
Comment #14
sam152 commentedHere is the BC breaking version.
Comment #15
sam152 commentedFixed broken vimeo handler.
Comment #32
sam152 commentedAnd another one..
Comment #37
sam152 commentedShould pass with a few alterations.
Comment #42
sam152 commentedComment #47
sam152 commentedComment #48
sam152 commented