aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/transforms
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-02 11:32:16 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-11-02 11:32:16 -0700
commit2137be14556a604a06e8b54bbc22d68f7d3cd695 (patch)
tree30a23b96afac28d0af57877b0031f10d8569373b /python/fatcat_tools/transforms
parentfdbfb8dc55df8c3739feca8c52c017c56b006573 (diff)
parent6184ecca3a2e072c11482020938566dc8841bf52 (diff)
downloadfatcat-2137be14556a604a06e8b54bbc22d68f7d3cd695.tar.gz
fatcat-2137be14556a604a06e8b54bbc22d68f7d3cd695.zip
Merge branch 'bnewbold-import-fileset'
Diffstat (limited to 'python/fatcat_tools/transforms')
-rw-r--r--python/fatcat_tools/transforms/ingest.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/python/fatcat_tools/transforms/ingest.py b/python/fatcat_tools/transforms/ingest.py
index 42927b2a..9101a4ec 100644
--- a/python/fatcat_tools/transforms/ingest.py
+++ b/python/fatcat_tools/transforms/ingest.py
@@ -32,8 +32,22 @@ def release_ingest_request(release, ingest_request_source='fatcat', ingest_type=
if (not ingest_type) and release.container_id:
ingest_type = INGEST_TYPE_CONTAINER_MAP.get(release.container_id)
+
if not ingest_type:
- ingest_type = 'pdf'
+ if release.release_type == 'stub':
+ return None
+ elif release.release_type in ['component', 'graphic']:
+ ingest_type = 'component'
+ elif release.release_type == 'dataset':
+ ingest_type = 'dataset'
+ elif release.release_type == 'software':
+ ingest_type = 'software'
+ elif release.release_type == 'post-weblog':
+ ingest_type = 'html'
+ elif release.release_type in ['article-journal', 'article', 'chapter', 'paper-conference', 'book', 'report', 'thesis']:
+ ingest_type = 'pdf'
+ else:
+ ingest_type = 'pdf'
# generate a URL where we expect to find fulltext
url = None