Skip to content
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

Update Engine HydrateAssetPolicies() method for delivery channel model #622

Closed
tomcrane opened this issue Sep 20, 2023 · 4 comments · Fixed by #755
Closed

Update Engine HydrateAssetPolicies() method for delivery channel model #622

tomcrane opened this issue Sep 20, 2023 · 4 comments · Fixed by #755
Assignees
Labels
C-W delivery-channels jira marks issue for crossposting to JIRA

Comments

@tomcrane
Copy link
Contributor

tomcrane commented Sep 20, 2023

Load full delivery channels information and update Asset model correctly.

Everything in Engine should read the policies populated here rather than fetch again - load the asset, use EF include to populate the actual values of dc policies (e.g., thumb sizes) and then this is used from here on in Engine.

Acceptance Criteria

  • On receipt of sync or async method the Engine will fetch Asset from database, whether we receive fully hydrated object or not.
  • This fetch includes all policyData that Engine will use for processing.
@tomcrane
Copy link
Contributor Author

Make sure child properties are populated when you ask the DB for an asset - in this scenario where Engine always needs to know the delivery channels.

@tomcrane
Copy link
Contributor Author

Compare with current:

private async Task HydrateAssetPolicies(Asset asset)
{
if (!string.IsNullOrEmpty(asset.ThumbnailPolicy))
{
var thumbnailPolicy = await policyRepository.GetThumbnailPolicy(asset.ThumbnailPolicy);
asset.WithThumbnailPolicy(thumbnailPolicy);
}
if (!string.IsNullOrEmpty(asset.ImageOptimisationPolicy))
{
var optimisationPolicy =
await policyRepository.GetImageOptimisationPolicy(asset.ImageOptimisationPolicy, asset.Customer);
asset.WithImageOptimisationPolicy(optimisationPolicy);
}
}

@tomcrane
Copy link
Contributor Author

This includes updating Engine to use these policies, as well as Elastic Transcoder

@JackLewis-digirati
Copy link
Contributor

This ticket also encompassed the removal of InitialOrigin from an asset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-W delivery-channels jira marks issue for crossposting to JIRA
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants