Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
Index contentMetadata mimetypes regardless of whether the file is she…
Browse files Browse the repository at this point in the history
…lved or not
  • Loading branch information
cbeer committed Feb 6, 2018
1 parent 7e1e5fa commit 3a50dd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/dor/datastreams/content_metadata_ds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ def to_solr(solr_doc = {}, *args)
counts['content_file'] += 1
preserved_size += file['size'].to_i if file['preserve'] == 'yes'
shelved_size += file['size'].to_i if file['shelve'] == 'yes'
next unless file['shelve'] == 'yes'
counts['shelved_file'] += 1
first_shelved_image ||= file['id'] if file['id'] =~ /jp2$/
if file['shelve'] == 'yes'
counts['shelved_file'] += 1
first_shelved_image ||= file['id'] if file['id'] =~ /jp2$/
end
mime_types << file['mimetype']
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/datastreams/content_metadata_ds_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
it 'should generate required fields' do
expected = {
'content_type_ssim' => 'map',
'content_file_mimetypes_ssim' => ['image/jp2'],
'content_file_mimetypes_ssim' => ['image/jp2', 'image/gif', 'image/tiff'],
'shelved_content_file_count_itsi' => 1,
'resource_count_itsi' => 1,
'content_file_count_itsi' => 3,
Expand Down

0 comments on commit 3a50dd8

Please sign in to comment.