aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/entity_helpers.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-01-31 17:08:04 -0800
committerBryan Newbold <bnewbold@robocracy.org>2020-02-13 22:24:20 -0800
commit88d095fb369dea5c993c78e85be08df5283d6436 (patch)
tree2ab1d93660b30a3709204cf0f2a0ee64a346ed92 /python/fatcat_web/entity_helpers.py
parent3011c6a088498ba566672d35aeee805c762808ba (diff)
downloadfatcat-88d095fb369dea5c993c78e85be08df5283d6436.tar.gz
fatcat-88d095fb369dea5c993c78e85be08df5283d6436.zip
filter out shadows-only files in webface
Diffstat (limited to 'python/fatcat_web/entity_helpers.py')
-rw-r--r--python/fatcat_web/entity_helpers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py
index af0fea83..022d6f99 100644
--- a/python/fatcat_web/entity_helpers.py
+++ b/python/fatcat_web/entity_helpers.py
@@ -53,6 +53,10 @@ def enrich_release_entity(entity):
entity._es = release_to_elasticsearch(entity, force_bool=False)
if entity.container and entity.container.state == "active":
entity.container._es = container_to_elasticsearch(entity.container, force_bool=False)
+ if entity.files:
+ # remove shadows-only files with no URLs
+ entity.files = [f for f in entity.files
+ if not (not f.urls and f.extra and f.extra.get('shadows'))]
if entity.filesets:
for fs in entity.filesets:
fs._total_size = sum([f.size for f in fs.manifest])