Skip to content

Commit

Permalink
Fix metadata render
Browse files Browse the repository at this point in the history
  • Loading branch information
johnf committed Oct 28, 2024
1 parent d636479 commit 61b3328
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/jobs/catalog_metadata_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ class CatalogMetadataJob < ApplicationJob
def perform(data, is_item)
local_data = { data:, is_item:, admin_rocrate: true }

rocrate = Api::V1::OniController.render :object_meta, assigns: local_data

filename = 'ro-crate-metadata.json'

if is_item
# data = data.includes(:content_languages, :subject_languages, item_agents: %i[agent_role user])
rocrate = Api::V1::OniController.render :object_meta_item, assigns: local_data
Nabu::Catalog.instance.upload_item_admin(data, filename, rocrate, 'application/json')
else
# data = data.includes(items: [:admins, :users]) # => { :content_languages, :subject_languages, item_agents: %i[agent_role user] } })
rocrate = Api::V1::OniController.render :object_meta_collection, assigns: local_data
Nabu::Catalog.instance.upload_collection_admin(data, filename, rocrate, 'application/json')
end
end
Expand Down

0 comments on commit 61b3328

Please sign in to comment.