Skip to content

Commit

Permalink
Merge pull request #38 from performant-software/feature/iiif37_manife…
Browse files Browse the repository at this point in the history
…st_url

IIIF #37 - Manifest URL
  • Loading branch information
dleadbetter authored Jan 3, 2024
2 parents 79d2f07 + 6762340 commit c95eaf1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/serializers/resources_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ class ResourcesSerializer < BaseSerializer

index_attributes :id, :uuid, :name, :exif, :project_id, :content_url, :content_thumbnail_url, :content_iiif_url,
:content_preview_url, :content_download_url, :content_inline_url, :manifest, :content_type

index_attributes(:manifest_url) { |resource| manifest_url(resource) }

show_attributes :id, :uuid, :name, :exif, :project_id, :content_url, :content_thumbnail_url, :content_iiif_url,
:content_preview_url, :content_download_url, :content_inline_url, :manifest, :content_type

show_attributes(:manifest_url) { |resource| manifest_url(resource) }

def self.manifest_url(resource)
"#{ENV['HOSTNAME']}/public/resources/#{resource.uuid}/manifest"
end
end

0 comments on commit c95eaf1

Please sign in to comment.