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

Replace string[] DeliveryChannels with DeliveryChannel[] DeliveryChannels #717

Closed
tomcrane opened this issue Jan 25, 2024 · 2 comments · Fixed by #734
Closed

Replace string[] DeliveryChannels with DeliveryChannel[] DeliveryChannels #717

tomcrane opened this issue Jan 25, 2024 · 2 comments · Fixed by #734
Assignees
Labels
delivery-channels jira marks issue for crossposting to JIRA

Comments

@tomcrane
Copy link
Contributor

tomcrane commented Jan 25, 2024

Replace the string[] DeliveryChannels property on the Hydra Image API class in the DLCS with DeliveryChannel[] DeliveryChannels as per the new documentation. Nothing will be calling this any more. All old calls still get routed to OldDeliveryChannels via .wcDeliveryChannels on hydra JSON.

Leave that property intact on the Hydra class, but ALL use of it within the DLCS is now for removal, as the new behaviour is implemented. We'll come back to deal with this property in #714

This is a very small task but is the prep for the full implementation work.

We also, during the full implementation, need to remove all usage of ImageOptimisationPolicy and ThumbnailPolicy.

We don't necessarily have to have a specific task to rip it all out before introducing the new DeliveryChannels. Better to replace bit by bit, so we can see what the old code is doing in places as we implement the new. But the old code will never more be executed, and by the end of the work, the fields and the code that uses them must be gone.

@tomcrane
Copy link
Contributor Author

tomcrane commented Feb 6, 2024

Acceptance criteria

  • There is a DeliveryChannel Hydra class
  • For this ticket, posting new DeliveryChannels is a no-op (impl happens in other tickets)
  • The DLCS model class Asset stays the same, but we translate from hydra wcDeliveryChannels to Asset.DeliveryChannels, e.g., at
    asset.DeliveryChannels = hydraImage.DeliveryChannels.OrderBy(dc => dc).Select(dc => dc.ToLower()).ToArray();
  • wcDeliveryChannels becomes string[] and is used directly

@tomcrane
Copy link
Contributor Author

    [JsonProperty(Order = 141, PropertyName = "wcDeliveryChannels")]
    public string[]? WcDeliveryChannels { get; set; } // requires refactor first

    [JsonProperty(Order = 140, PropertyName = "deliveryChannels")]
    public DeliveryChannel[]? DeliveryChannels { get; set; }

@sarahos sarahos added the jira marks issue for crossposting to JIRA label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delivery-channels jira marks issue for crossposting to JIRA
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants