aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-03-31 12:34:42 -0700
committerBryan Newbold <bnewbold@robocracy.org>2022-03-31 12:34:42 -0700
commit0649549664b84d7f5c3d0b9c0b03f1a8b4a88491 (patch)
treee599636c500079823693aced855effb5b5ddeb5a /python
parentee1195a14bde28aaf4e630046c31d0c9f5f19530 (diff)
downloadfatcat-0649549664b84d7f5c3d0b9c0b03f1a8b4a88491.tar.gz
fatcat-0649549664b84d7f5c3d0b9c0b03f1a8b4a88491.zip
fileset ingest: fix mimetype handling
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/importers/ingest.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/fatcat_tools/importers/ingest.py b/python/fatcat_tools/importers/ingest.py
index 47032b26..ed948606 100644
--- a/python/fatcat_tools/importers/ingest.py
+++ b/python/fatcat_tools/importers/ingest.py
@@ -779,11 +779,10 @@ class IngestFilesetResultImporter(IngestFileResultImporter):
md5=ingest_file["md5"],
sha1=ingest_file["sha1"],
sha256=ingest_file.get("sha256"),
- extra=dict(
- mimetype=ingest_file["mimetype"],
- ),
+ mimetype=ingest_file["mimetype"],
+ extra=dict(),
)
- if not (fsf.md5 and fsf.sha1 and fsf.path and fsf.size):
+ if not (fsf.md5 and fsf.sha1 and fsf.path and fsf.size and fe.mimetype):
self.counts["skip-partial-file-info"] += 1
return None
if ingest_file.get("platform_url"):
@@ -793,6 +792,8 @@ class IngestFilesetResultImporter(IngestFileResultImporter):
fsf.extra[
"wayback_url"
] = f"https://web.archive.org/web/{ingest_file['terminal_dt']}/{ingest_file['terminal_url']}"
+ if not fsf.extra:
+ fsf.extra = None
manifest.append(fsf)
fe = fatcat_openapi_client.FilesetEntity(