Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more fixes for old collection thumbnail path support #2343

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading