Skip to content

Commit

Permalink
Adds iiif_collection field to collection index
Browse files Browse the repository at this point in the history
  • Loading branch information
kdid committed Oct 23, 2024
1 parent e998276 commit 22f6635
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 22f6635

Please sign in to comment.