aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-04-12 16:36:46 -0700
committerBryan Newbold <bnewbold@archive.org>2021-04-12 16:36:46 -0700
commit4871b00983b7105aab8087ec4882fad922d39707 (patch)
tree6a62e2a5e9fb230fcdd91742199df1807b2c3d0e
parent06e1b31fa2262fd5367d13f99d1edef0b896a9f1 (diff)
downloadfatcat-scholar-4871b00983b7105aab8087ec4882fad922d39707.tar.gz
fatcat-scholar-4871b00983b7105aab8087ec4882fad922d39707.zip
indexing: defer to creator.display_name over contrib.raw_name
-rw-r--r--fatcat_scholar/schema.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/fatcat_scholar/schema.py b/fatcat_scholar/schema.py
index b93962c..9912a97 100644
--- a/fatcat_scholar/schema.py
+++ b/fatcat_scholar/schema.py
@@ -452,7 +452,9 @@ def scrub_text(raw: str, mimetype: str = None) -> Optional[str]:
def contrib_name(contrib: ReleaseContrib) -> str:
# TODO: support more cultural normals for name presentation
- if contrib.raw_name:
+ if contrib.creator and contrib.creator.display_name:
+ return contrib.creator.display_name
+ elif contrib.raw_name:
return contrib.raw_name
elif contrib.given_name and contrib.surname:
return f"{contrib.given_name} {contrib.surname}"