Skip to content

Commit

Permalink
Add import_url to file set attributes
Browse files Browse the repository at this point in the history
This adds import_url to the attributes for creating a Valkyrized file set.

To actually save the import_url on a file set, the application needs to:
- add import_url to the file_set metadata attributes in your app
- decorate Hyrax::WorkUploadsHandler to add import_url to the
file_set_args method
  • Loading branch information
laritakr committed Sep 18, 2024
1 parent b511db6 commit 9812904
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/factories/bulkrax/valkyrie_object_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def prep_fileset_content(attrs)
thumbnail_url = HashWithIndifferentAccess.new(self.attributes)['thumbnail_url']
all_remote_files = merge_thumbnails(remote_files: attrs["remote_files"], thumbnail_url: thumbnail_url)
# combine local & remote files [Array < Hash &/or String]
all_local_files = self.attributes['file']
all_local_files = self.attributes['file'] || []
all_files = all_local_files + all_remote_files

# collect all uploaded files [Array < Hyrax::UploadedFile]
Expand Down Expand Up @@ -307,7 +307,9 @@ def file_set_params_for(uploads:, files:)
when String
{}
else
f.reject { |key, _| key.to_s == 'url' || key.to_s == 'file_name' }
temp = f.reject { |key, _| key.to_s == 'url' || key.to_s == 'file_name' }
temp['import_url'] = f['url']
temp
end
end

Expand Down

0 comments on commit 9812904

Please sign in to comment.