diff --git a/app/serializers/resources_serializer.rb b/app/serializers/resources_serializer.rb index 4b9549a..cfc22a3 100644 --- a/app/serializers/resources_serializer.rb +++ b/app/serializers/resources_serializer.rb @@ -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