Skip to content

Commit

Permalink
Viewer fails for older fedora files
Browse files Browse the repository at this point in the history
Expected term wasn't indexed, so adding a fallback
  • Loading branch information
laritakr committed Oct 2, 2024
1 parent 655254f commit eb5f887
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ module CanvasBuilderFactoryDecorator
def from(work)
composite_builder.new(
*file_set_presenters(work).map do |presenter|
next if presenter.solr_document['original_filename_ssi'].downcase.end_with?(HykuKnapsack::Engine::THUMBNAIL_FILE_SUFFIX) || !presenter.image?
next if original_filename&.downcase.end_with?(HykuKnapsack::Engine::THUMBNAIL_FILE_SUFFIX) || !presenter.image?
canvas_builder_factory.new(presenter, work)
end
)
end
end

# fallback to label_ssi if original_filename isn't indexed
def original_filename
presenter.solr_document['original_filename_ssi'] || presenter.solr_document['label_ssi']
end
end
end

Expand Down

0 comments on commit eb5f887

Please sign in to comment.