samvera / valkyrie

A Data Mapper library to enable multiple backends for storage of files and metadata in Samvera
Other
34 stars 23 forks source link

Add #version to storage adapters #940

Closed dlpierce closed 1 year ago

dlpierce commented 1 year ago

Rationale

An application should not need to know the implementation details of each storage adapter to discover what version a given file is. Version info is helpful when Hyrax builds a iiif manifest that includes version identifiers in the image ids.

Notes

tpendragon commented 1 year ago

Files already respond to version_id - is the proposal here to have a more human readable version?

dlpierce commented 1 year ago

Yes, I guess it breaks down to having a more readable version.

It felt wrong to be deciphering the version from the file's uri in version_id differently depending on the storage adapter in use.

dlpierce commented 1 year ago

My intention was version returns only the portion of version_id that changes when a new version is created, but you make good arguments for that not being a simple determination for some backends.

Hashing the whole version_id should be sufficient for what hyrax needs. Thanks!