Enable a collection's adminThumbnail to execute regardless of MIME type
#3063
sannajammeh
started this conversation in
Feature Requests & Ideas
Replies: 1 comment 1 reply
-
|
Hey @sannajammeh — I see what you're going for here. I would happily merge a PR to make this function work as intended. Here's the code that would need to be modified (I think this is the one spot that would need attention). If a dev provides a function to the It would be pretty simple and painless I think! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The
adminThumbnailproperty has two states, string or function. As it currently stands, Payload will refuse to execute theadminThumbnailmethod on the frontend if the uploaded content is not of animage/*mime type. This is counterintuitive.Use cases for enabling
Current Workaround:
This function can execute regardless of mime type, payload does not do it. If you swap the mime type of a video inside MongoDB from
video/mp4toimage/jpegthe function will execute.The final MongoDB document of a video would look like this
{ "name": "...", ...FileProps, "mimeType": "image/jpeg", // Overrided type so Payload will execute "_mimeType": "video/mp4" // For consumption if required by consumer }Example
This example utilises Bunny CDN's own thumbnail generator. Again this WORKS if you swap the mime type of the MongoDB document.
Beta Was this translation helpful? Give feedback.
All reactions