Skip to content

Commit

Permalink
🧹 discards any prefixes before /branding
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaLMoore committed May 31, 2024
1 parent 24de07c commit bfacef0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/forms/hyrax/forms/pcdm_collection_form_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if thumbnail_info
thumbnail_file = File.split(thumbnail_info.local_path).last
alttext = thumbnail_info.alt_text
file_location = thumbnail_info.local_path.gsub('/app/samvera', '')
file_location = thumbnail_info.local_path.gsub(/.*?(\/branding)/, '\1')
relative_path = "/" + thumbnail_info.local_path.split("/")[-4..-1].join("/")
{ file: thumbnail_file, full_path: file_location, relative_path:, alttext: }
else
Expand Down
2 changes: 1 addition & 1 deletion app/services/hyrax/indexes_thumbnails_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def thumbnail_path
if object.try(:collection?) && UploadedCollectionThumbnailPathService.uploaded_thumbnail?(object)
UploadedCollectionThumbnailPathService.call(object)
else
CollectionResourceIndexer.thumbnail_path_service.call(object)&.gsub('/app/samvera', '')
CollectionResourceIndexer.thumbnail_path_service.call(object)&.gsub(/.*?(\/branding)/, '\1')
end
end
end
Expand Down

0 comments on commit bfacef0

Please sign in to comment.