lib/bolognese/readers/datacite_reader.rb in bolognese-0.9.54 vs lib/bolognese/readers/datacite_reader.rb in bolognese-0.9.55
- old
+ new
@@ -47,10 +47,15 @@
if options[:validate]
errors = datacite_errors(xml: string, schema_version: schema_version)
return { "errors" => errors } if errors.present?
end
- id = normalize_doi(meta.dig("identifier", "__content__"), sandbox: options[:sandbox])
+ if options[:doi]
+ id = normalize_doi(options[:doi], sandbox: options[:sandbox])
+ else
+ id = normalize_doi(meta.dig("identifier", "__content__"), sandbox: options[:sandbox])
+ end
+
doi = doi_from_url(id)
if options[:url]
url = options[:url]
else