summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/importers/datacite.py6
-rw-r--r--python/tests/files/datacite/datacite_result_16.json1
2 files changed, 4 insertions, 3 deletions
diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py
index 0481337a..6c050565 100644
--- a/python/fatcat_tools/importers/datacite.py
+++ b/python/fatcat_tools/importers/datacite.py
@@ -729,7 +729,7 @@ class DataciteImporter(EntityImporter):
# figshare
if re.ext_ids.doi.startswith('10.6084/') or re.ext_ids.doi.startswith('10.25384'):
# set version if DOI ends with versioned suffix
- doi_suffix = re.ext_ids.doi.split('.')
+ doi_suffix = re.ext_ids.doi.split('.')[-1]
if doi_suffix and doi_suffix.startswith('v') and doi_suffix[1:].isdigit():
re.version = doi_suffix
# "Figure 123 from " -> component
@@ -741,8 +741,8 @@ class DataciteImporter(EntityImporter):
re.release_type = "component"
# figshare.com
- if re.ext_ids.doi.startswith('10.6084/m9.figshare.') and re.container_name is None:
- re.container_name = "figshare.com"
+ if re.ext_ids.doi.startswith('10.6084/m9.figshare.') and re.extra.get('container_name') is None:
+ re.extra['container_name'] = "figshare.com"
return re
diff --git a/python/tests/files/datacite/datacite_result_16.json b/python/tests/files/datacite/datacite_result_16.json
index ef26c47c..d0b933d1 100644
--- a/python/tests/files/datacite/datacite_result_16.json
+++ b/python/tests/files/datacite/datacite_result_16.json
@@ -13,6 +13,7 @@
"doi": "10.6084/m9.figshare.1282478"
},
"extra": {
+ "container_name": "figshare.com",
"datacite": {
"license": [
{