aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-10-26 18:13:38 -0700
committerBryan Newbold <bnewbold@archive.org>2021-10-26 18:13:40 -0700
commit41fae4c294e2ba43370b4a4193c0f6107201dbf0 (patch)
tree49899fa19fe6a0c4da4ef70f402df8ee8a3bc17d
parent485dd2cfd120c52bbc5cc7745e44176d1003b40d (diff)
downloadsandcrawler-41fae4c294e2ba43370b4a4193c0f6107201dbf0.tar.gz
sandcrawler-41fae4c294e2ba43370b4a4193c0f6107201dbf0.zip
bugfix: setting html_biblio on ingest results
This was caught during lint cleanup
-rw-r--r--python/sandcrawler/ingest_file.py2
-rw-r--r--python/sandcrawler/ingest_fileset.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/python/sandcrawler/ingest_file.py b/python/sandcrawler/ingest_file.py
index b3f2a8e..49c7ddf 100644
--- a/python/sandcrawler/ingest_file.py
+++ b/python/sandcrawler/ingest_file.py
@@ -682,7 +682,7 @@ class IngestFileWorker(SandcrawlerWorker):
html_doc = HTMLParser(resource.body)
html_biblio = html_extract_biblio(resource.terminal_url, html_doc)
if html_biblio:
- if not 'html_biblio' in result or html_biblio.title:
+ if 'html_biblio' not in result and html_biblio.title:
result['html_biblio'] = json.loads(
html_biblio.json(exclude_none=True))
#print(f" setting html_biblio: {result['html_biblio']}", file=sys.stderr)
diff --git a/python/sandcrawler/ingest_fileset.py b/python/sandcrawler/ingest_fileset.py
index bf06a39..d88fb46 100644
--- a/python/sandcrawler/ingest_fileset.py
+++ b/python/sandcrawler/ingest_fileset.py
@@ -177,7 +177,7 @@ class IngestFilesetWorker(IngestFileWorker):
html_doc = HTMLParser(resource.body)
html_biblio = html_extract_biblio(resource.terminal_url, html_doc)
if html_biblio:
- if not 'html_biblio' in result or html_biblio.title:
+ if 'html_biblio' not in result and html_biblio.title:
result['html_biblio'] = json.loads(
html_biblio.json(exclude_none=True))
#print(f" setting html_biblio: {result['html_biblio']}", file=sys.stderr)