From 786c19220a88df89535bba79123b80cde1da2931 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 23 Mar 2020 14:22:30 -0700 Subject: jalc: avoid meaningless pages values --- python/fatcat_tools/importers/jalc.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'python/fatcat_tools') 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 -- cgit v1.2.3