sul-dlss / purl-fetcher

An HTTP API for querying and updating PURLs
0 stars 1 forks source link

Purls Controller show should be version aware and check file existence #876

Closed justinlittman closed 1 month ago

justinlittman commented 1 month ago

Purls Controller show returns the md5s of shelved files. Currently, it just returns the md5s extracted from the cocina stored in the DB.

It should be changed so that:

  1. If an object is versioned, it returns the md5s of all the files from the contents directory (using the filename).
  2. If an object is unversioned, return the md5s from the cocina stored in the DB, making sure that each file exists. If an expected file doesn't exist, HB alert and omit from returned MD5s.
cbeer commented 1 month ago

I'm glad you filed this ticket. I couldn't figured out how the method comment could possibly be true: https://github.com/sul-dlss/purl-fetcher/blob/main/app/models/public_json.rb#L16