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 sdr client #3083

Merged
merged 3 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ GEM
public_suffix (5.0.1)
puma (5.6.5)
nio4r (~> 2.0)
racc (1.7.0)
racc (1.7.1)
rack (2.2.7)
rack-test (2.1.0)
rack (>= 1.3)
Expand Down Expand Up @@ -466,7 +466,7 @@ GEM
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
sdr-client (2.4.0)
sdr-client (2.5.0)
activesupport
cocina-models (~> 0.90.0)
config
Expand Down
7 changes: 1 addition & 6 deletions app/jobs/deposit_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,12 @@ def build_file_metadata(blobs_map)
SdrClient::Deposit::Files::DirectUploadRequest.new(
checksum: blob.checksum,
byte_size: blob.byte_size,
content_type: clean_content_type(blob.content_type),
content_type: blob.content_type,
filename: blob.filename.to_s
)
end
end

def clean_content_type(content_type)
# ActiveStorage is expecting "application/x-stata-dta" not "application/x-stata-dta;version=14"
content_type&.split(';')&.first
end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this logic is now handled in the new version of sdr-client, so we don't need it here anymore

Copy link
Member

@jmartin-sul jmartin-sul Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! ok, yeah, i like moving this into sdr-client, despite my wishy-washy feedback on the sdr-client PR. hadn't looked at this yet, so wasn't sure whether there'd be redundant processing (which i was more worried about for intelligibility than for performance reasons).

def blob_filepath_for(blob)
ActiveStorage::Blob.service.path_for(blob.key)
end
Expand Down