Skip to content

Commit

Permalink
assumes physical instantiation in absence of a format/digitalInstanti…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
ekemeyer authored Jan 7, 2025
1 parent 47a8f9a commit 2f8e5c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/parsers/pbcore_xml_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ def set_objects(file, index)
def instantiation_rows(instantiations, xml_asset, asset, asset_id)
xml_records = []
instantiations.each.with_index do |inst, i|
instantiation_class = 'PhysicalInstantiationResource' if inst.physical
instantiation_class ||= 'DigitalInstantiationResource' if inst.digital
instantiation_class = 'PhysicalInstantiationResource' if inst.nil? || inst.physical
instantiation_class ||= 'DigitalInstantiationResource' if inst&.digital
next unless instantiation_class
xml_record = AAPB::BatchIngest::PBCoreXMLMapper.new(inst.to_xml).send("#{instantiation_class.to_s.underscore}_attributes").merge!({ pbcore_xml: inst.to_xml, skip_file_upload_validation: true })
# Find members of the asset that have the same class and local identifier. If no asset, then no digital instantiation can exist
Expand Down

0 comments on commit 2f8e5c7

Please sign in to comment.