Skip to content

Commit

Permalink
Merge pull request #815 from galterlibrary/801-export_metadata_subfie…
Browse files Browse the repository at this point in the history
…ld_formats

[#801] Export Metadata Subfield Formats
  • Loading branch information
Meowcenary committed Jan 21, 2021
2 parents 32dfdd6 + 84f451c commit b5ed150
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 2 additions & 6 deletions app/models/invenio_rdm_record_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def invenio_metadata(gf)
"resource_type": resource_type(gf.resource_type.shift),
"creators": creators(gf.creator),
"title": gf.title.first,
"additional_titles": gf.title.last(gf.title.size-1).map{ |title| {"title": title, "type": "alternative_title", "lang": "eng"} }
"additional_titles": gf.title.last(gf.title.size-1).map{ |title| {"title": title, "type": "alternative_title", "lang": "eng"} },
"formats": gf.mime_type
}
end

Expand Down Expand Up @@ -137,9 +138,4 @@ def creators(creators)
}
end
end

def format_creator_names(creator_name)
family_name = creator_name.pop # remove last value from display name
given_name = creator_name.join(' ') # the remaining strings becomes given name
end
end
6 changes: 4 additions & 2 deletions spec/models/invenio_rdm_record_converter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
proxy_depositor: assistant.username,
on_behalf_of: user.username,
creator: [user.formal_name],
title: ["Primary Title"]
title: ["Primary Title"],
mime_type: 'application/pdf'
)
}
let(:json) do
Expand Down Expand Up @@ -50,7 +51,8 @@
"title": "Tertiary Title",
"type": "alternative_title",
"lang": "eng"
}]
}],
"formats": "application/pdf"
},
"provenance": {
"created_by": {
Expand Down

0 comments on commit b5ed150

Please sign in to comment.