summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/routes.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-03-02 17:26:07 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-03-02 17:26:07 -0800
commit20ad70b437df59d9564704b655afab53237b8ce0 (patch)
tree5b16e7dbb88ad7b81556bdfb978b3b5fba99a98f /python/fatcat_web/routes.py
parent2235e696f96f761cfecacb7894c2cc78fc296da2 (diff)
downloadfatcat-20ad70b437df59d9564704b655afab53237b8ce0.tar.gz
fatcat-20ad70b437df59d9564704b655afab53237b8ce0.zip
include filesets and webcaptures in release view
Diffstat (limited to 'python/fatcat_web/routes.py')
-rw-r--r--python/fatcat_web/routes.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py
index 5ccfe238..59f7d1db 100644
--- a/python/fatcat_web/routes.py
+++ b/python/fatcat_web/routes.py
@@ -363,8 +363,8 @@ def release_edit_view(ident):
def release_view(ident):
try:
entity = api.get_release(ident, expand="container,files,filesets,webcaptures")
- files = entity.files
container = entity.container
+ filesets = entity.filesets
except ApiException as ae:
abort(ae.status)
if entity.state == "redirect":
@@ -375,17 +375,13 @@ def release_view(ident):
entity.container.es = container_to_elasticsearch(entity.container, force_bool=False)
if entity.state == "active":
entity.es = release_to_elasticsearch(entity, force_bool=False)
+ for fs in filesets:
+ fs.total_size = sum([f.size for f in fs.manifest])
+ entity.filesets = filesets
authors = [c for c in entity.contribs if c.role in ('author', None)]
authors = sorted(authors, key=lambda c: c.index)
- for fe in files:
- # crudely filter out exact duplicates
- kept = []
- for u in fe.urls:
- if not u in kept:
- kept.append(u)
- fe.urls = [u for u in kept if not '/web/None/' in u.url]
return render_template('release_view.html', release=entity,
- authors=authors, files=files, container=container)
+ authors=authors, container=container)
@app.route('/work/create', methods=['GET'])
def work_create_view():