sul-dlss / stacks

Delivering digital resources to patrons.
http://stacks.stanford.edu
5 stars 2 forks source link

[refactor] Pass StacksFile into the StacksImage #1189

Closed jcoyne closed 1 month ago

jcoyne commented 1 month ago

This means that StacksImage doesn't need to know how to create its own StacksFile.

This also makes the initializer of StacksImage explicit, which helps the reader to understand which attributes are required.

This supports moving to content addressable storage.

cbeer commented 1 month ago

If we're going to do this, can we also refactor the other models (StacksMediaStream .... unclear to me if StacksMediaToken needs it) to match?

It looks like that was potential future work hanging out from the refactor in #643. I think early on in the stacks architecture, we were pretending media + IIIF might not be backed by an actual file in /stacks (see geo, webarchiving, etc). Hopefully that ship has sailed.

jcoyne commented 1 month ago

@cbeer I did StacksMediaStream, but I don't think we want to extend this into StacksMediaToken because then create_from_encrypted_string would need to be aware of StacksFile.