-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assets not loading from object #11
Comments
Hi @emilsedgh, To work around that we just created the Assets.js file and updated the references to it. We have to manually update this part of the codebase every time anyway along with one or two other things. If you wanted to submit a pull request that would be awesome. We'll work it in with the generated code each time which we do anyway right now until we can fully automate it. It would be great if you could submit a pull requ |
I'll try to come up with a patch soon. Is there any similar bug that'd prevent |
I never used constructFromObject or tried to work it out to be honest, which is why it never got any attention or checks. Most users just use the classes similar to how we use them in our demo project, like this: https://github.com/shotstack/node-demos/blob/main/examples/images.js. The other way is to skip the SDK and just JSON.stringify the whole edit object and use fetch or axios to post to the API. If you don't get a chance to look at it I will see what I can do in the next SDK update. |
Using
editor.constructFromObject
to populate a whole editor fails on Assets.From what I'm seeing here, this fails because at here, it's obvious that Asset can't really populate from an object.
It appears that for each asset, there is a different model defined, like LumaAsset or TitleAsset.
But the Clip model doesn't really distribute the asset to any of them. Instead it goes directly to Asset model, which does nothing.
I think
Asset.constructFromObject
should be able to see thetype
, and based on that, invoke another model.I would normally provide a pull request, but this is all auto-generated so I have no idea how to fix this.
The text was updated successfully, but these errors were encountered: