From e2bcaba3381c5af5f40f0c1ec2ccb5bdcdd18c7f Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 6 Jan 2022 07:30:00 -0800 Subject: SIM transform: handle multiple publishers --- fatcat_scholar/transform.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'fatcat_scholar') diff --git a/fatcat_scholar/transform.py b/fatcat_scholar/transform.py index ae4a181..c7d49d3 100644 --- a/fatcat_scholar/transform.py +++ b/fatcat_scholar/transform.py @@ -169,6 +169,10 @@ def es_biblio_from_sim(sim: Dict[str, Any]) -> ScholarBiblio: language = language[0] lang_code = SIM_LANG_MAP.get(language) + publisher = issue_meta.get("publisher") or pub_meta.get("publisher") + if isinstance(publisher, list): + publisher = publisher[0] + return ScholarBiblio( # release_ident=release.ident, title=None, @@ -192,7 +196,7 @@ def es_biblio_from_sim(sim: Dict[str, Any]) -> ScholarBiblio: # number=None, # no external identifiers # license_slug=release.license_slug, - publisher=issue_meta.get("publisher") or pub_meta.get("publisher"), + publisher=publisher, container_name=container_name, container_original_name=None, container_ident=None, # TODO -- cgit v1.2.3