aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-01-30 19:00:45 -0800
committerBryan Newbold <bnewbold@archive.org>2021-01-30 19:00:45 -0800
commit64e4a0b3c43b53f5c79e6f17a189c7f5ec113c5b (patch)
tree77eb5927a400ffd25178377a36a99952158c20c7
parentd5a578fe763599d495f3192e18396f99af4b388d (diff)
downloadfatcat-scholar-64e4a0b3c43b53f5c79e6f17a189c7f5ec113c5b.tar.gz
fatcat-scholar-64e4a0b3c43b53f5c79e6f17a189c7f5ec113c5b.zip
bigfix: try resolving lang_code list issue again
-rw-r--r--fatcat_scholar/transform.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/fatcat_scholar/transform.py b/fatcat_scholar/transform.py
index 4114885..18410c3 100644
--- a/fatcat_scholar/transform.py
+++ b/fatcat_scholar/transform.py
@@ -138,11 +138,10 @@ def es_biblio_from_sim(sim: Dict[str, Any]) -> ScholarBiblio:
if release_year and abs(release_year) > 2050:
release_year = None
- lang_code = SIM_LANG_MAP.get(issue_meta.get("language")) or SIM_LANG_MAP.get(
- pub_meta.get("language")
- )
- if isinstance(lang_code, list):
- lang_code = lang_code[0]
+ language = issue_meta.get("language") or pub_meta.get("language")
+ if isinstance(language, list):
+ language = language[0]
+ lang_code = SIM_LANG_MAP.get(language)
return ScholarBiblio(
# release_ident=release.ident,