diff --git a/app/models/embed/purl/resource_file.rb b/app/models/embed/purl/resource_file.rb index 942f3615f..538587579 100644 --- a/app/models/embed/purl/resource_file.rb +++ b/app/models/embed/purl/resource_file.rb @@ -57,10 +57,6 @@ def mimetype @file.attributes['mimetype'].try(:value) end - def previewable? - preview_types.include?(mimetype) - end - def image? mimetype =~ %r{image/jp2}i end @@ -88,12 +84,6 @@ def location_restricted? def world_downloadable? @rights.world_downloadable_file?(@file.attributes['id']) end - - private - - def preview_types - ['image/jp2'] - end end end end diff --git a/app/views/embed/body/_resource_file.html.erb b/app/views/embed/body/_resource_file.html.erb index c0f03291c..17da5950c 100644 --- a/app/views/embed/body/_resource_file.html.erb +++ b/app/views/embed/body/_resource_file.html.erb @@ -3,7 +3,7 @@ <%= viewer.purl_object.hierarchical? ? raw('  ') : file.index %>
- <% if file.previewable? %> + <% if file.image? %> <% else %> @@ -41,7 +41,7 @@ <% end %>
- <% if file.previewable? %> + <% if file.image? %> @@ -55,7 +55,7 @@ <% end %> - <% if file.previewable? %> + <% if file.image? %> diff --git a/spec/models/embed/purl/resource_file_spec.rb b/spec/models/embed/purl/resource_file_spec.rb index 9d2829030..7da46ee30 100644 --- a/spec/models/embed/purl/resource_file_spec.rb +++ b/spec/models/embed/purl/resource_file_spec.rb @@ -84,18 +84,6 @@ end end - describe 'previewable?' do - it 'returns true if the mimetype of the file is previewable' do - stub_purl_xml_response_with_fixture(image_purl_xml) - expect(Embed::Purl.new('12345').contents.first.files.first).to be_previewable - end - - it 'returns false if the mimetype of the file is not previewable' do - stub_purl_xml_response_with_fixture(file_purl_xml) - expect(Embed::Purl.new('12345').contents.first.files.first).not_to be_previewable - end - end - describe 'image?' do it 'returns true if the mimetype of the file is an image' do stub_purl_xml_response_with_fixture(image_purl_xml)