Skip to content

Commit

Permalink
Merge pull request #4233 from nulib/5174-iiif-collection
Browse files Browse the repository at this point in the history
Adds iiif_collection field to collection index
  • Loading branch information
kdid authored Oct 23, 2024
2 parents 227354f + 22f6635 commit a7fb379
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/lib/meadow/indexing/v2/collection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ defmodule Meadow.Indexing.V2.Collection do
featured: collection.featured,
finding_aid_url: collection.finding_aid_url,
id: collection.id,
iiif_collection: iiif_collection_id(collection),
indexed_at: NaiveDateTime.utc_now(),
keywords: collection.keywords,
modified_date: collection.updated_at,
Expand All @@ -40,4 +41,6 @@ defmodule Meadow.Indexing.V2.Collection do

def encode_label(%{label: label}), do: label
def encode_label(_), do: nil

defp iiif_collection_id(collection), do: "#{api_url()}/collections/#{collection.id}?as=iiif"
end

0 comments on commit a7fb379

Please sign in to comment.