Skip to content

Commit

Permalink
more fixes for old collection thumbnail path support (#2343)
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Sep 20, 2024
1 parent b193a39 commit 7f1c01a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/services/hyrax/thumbnail_path_service_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ def call(object)
collection_thumbnail = CollectionBrandingInfo.where(collection_id: object.id.to_s, role: "thumbnail").first
return collection_thumbnail.local_path.gsub(Hyrax.config.branding_path.to_s, '/branding') if collection_thumbnail

default_collection_image
return default_image if object.try(:thumbnail_id).blank?

thumb = fetch_thumbnail(object)
return default_collection_image unless thumb
return call(thumb) unless thumb.file_set?
if audio?(thumb)
audio_image
elsif thumbnail?(thumb)
thumbnail_path(thumb)
else
default_collection_image
end
end

def default_collection_image
Expand Down

0 comments on commit 7f1c01a

Please sign in to comment.