diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-06-29 17:39:08 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-06-29 17:39:08 -0700 |
commit | a16c54771f2a80d07f124387b3aca7d11c70a27b (patch) | |
tree | 9aa17bab76e1c53466063d1856b8c58aa1d620db /fatcat_scholar/transform.py | |
parent | c8f932a7335a89dcf6e505b04d9c3636718074ab (diff) | |
download | fatcat-scholar-a16c54771f2a80d07f124387b3aca7d11c70a27b.tar.gz fatcat-scholar-a16c54771f2a80d07f124387b3aca7d11c70a27b.zip |
fixes for pdf_meta dict
Diffstat (limited to 'fatcat_scholar/transform.py')
-rw-r--r-- | fatcat_scholar/transform.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fatcat_scholar/transform.py b/fatcat_scholar/transform.py index 5bedfd7..5bdd0c7 100644 --- a/fatcat_scholar/transform.py +++ b/fatcat_scholar/transform.py @@ -151,7 +151,7 @@ def _add_file_release_meta( fulltext.file_mimetype = fe.mimetype fulltext.access_url = best_url fulltext.access_type = best_url_type - if pdf_meta is not None and pdf_meta.get("has_page0_thumbnail"): + if pdf_meta is not None and pdf_meta["pdf_meta"].get("has_page0_thumbnail"): # eg: https://blobs.fatcat.wiki/thumbnail/pdf/32/29/322909fe57cef73b10a166996a4528d337026d16.180px.jpg fulltext.thumbnail_url = f"{ settings.THUMBNAIL_URL_PREFIX }{ fe.sha1[0:2] }/{ fe.sha1[2:4] }/{ fe.sha1 }.180px.jpg" return fulltext @@ -338,6 +338,7 @@ def run_transform(infile: Sequence) -> None: biblio_release_ident=obj.get("biblio_release_ident"), grobid_fulltext=obj.get("grobid_fulltext"), pdftotext_fulltext=obj.get("pdftotext_fulltext"), + pdf_meta=obj.get("pdf_meta"), sim_fulltext=obj.get("sim_fulltext"), ) es_doc = transform_heavy(heavy) |