This commit will allow the GenerateThumbsJob to be called on update if the preview field has been changed. We also handle errors better in case we don't have a valid URL for thumbnails. If we get a invalid URL then the existing thumbnail will be removed to better indicate that there was something wrong with the URL.
There is now a lot of duplication between the GenerateImageThumbsJob and the GeneratePdfThumbsJob. Perhaps a refactor in the future would be in order.
Story
This commit will allow the
GenerateThumbsJob
to be called on update if thepreview
field has been changed. We also handle errors better in case we don't have a valid URL for thumbnails. If we get a invalid URL then the existing thumbnail will be removed to better indicate that there was something wrong with the URL.There is now a lot of duplication between the
GenerateImageThumbsJob
and theGeneratePdfThumbsJob
. Perhaps a refactor in the future would be in order.Ref:
Expected Behavior Before Changes
Thumbnails on were being generated on create.
Expected Behavior After Changes
Thumbnails now generate on create and also when the
edm:preview
field gets updated.Screenshots / Video
https://github.com/scientist-softserv/west-virginia-university/assets/19597776/1d4638b0-f096-4f56-8ce1-21236163e839