aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-03-23 14:22:30 -0700
committerBryan Newbold <bnewbold@robocracy.org>2020-03-23 14:22:30 -0700
commit786c19220a88df89535bba79123b80cde1da2931 (patch)
treeef0917e407417abd2dbe12b03b8c7f8a9ea65234 /python
parent57943252a7fc1df7c19cadf68ae193af15d986ae (diff)
downloadfatcat-786c19220a88df89535bba79123b80cde1da2931.tar.gz
fatcat-786c19220a88df89535bba79123b80cde1da2931.zip
jalc: avoid meaningless pages values
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/importers/jalc.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/python/fatcat_tools/importers/jalc.py b/python/fatcat_tools/importers/jalc.py
index a0e0086b..351a20a3 100644
--- a/python/fatcat_tools/importers/jalc.py
+++ b/python/fatcat_tools/importers/jalc.py
@@ -209,10 +209,14 @@ class JalcImporter(EntityImporter):
release_year = int(date)
pages = None
- if record.startingPage:
- pages = record.startingPage.string
- if record.endingPage:
- pages = "{}-{}".format(pages, record.endingPage.string)
+ if record.startingPage and record.startingPage.string.strip():
+ pages = record.startingPage.string.strip()
+ if record.endingPage and record.endingPage.string.strip():
+ pages = "{}-{}".format(pages, record.endingPage.string.strip())
+ # double check to prevent "-" as pages
+ if pages and pages.strip() == '-':
+ pages = None
+
volume = None
if record.volume:
volume = record.volume.string