diff --git a/nyaa/routes.py b/nyaa/routes.py index e70f993..51a7dd3 100644 --- a/nyaa/routes.py +++ b/nyaa/routes.py @@ -504,7 +504,7 @@ def view_torrent(torrent_id): files = None if torrent.filelist: - files = utils.flattenDict(json.loads(torrent.filelist.filelist_blob.decode('utf-8'))) + files = json.loads(torrent.filelist.filelist_blob.decode('utf-8')) return flask.render_template('view.html', torrent=torrent, files=files, diff --git a/nyaa/templates/view.html b/nyaa/templates/view.html index 6496eb9..969a95e 100644 --- a/nyaa/templates/view.html +++ b/nyaa/templates/view.html @@ -79,20 +79,26 @@
- - - - - - - {%- for key, value in files.items() %} - - - - - {%- endfor %} - -
PathSize
{{ key }}{{ value | filesizeformat(True) }}
+ + + + + + + {%- for key, value in files.items() recursive %} + + {%- if value is iterable %} + + {{ loop(value.items()) }} + {%- else %} + + + {%- endif %} + + {%- endfor %} +
PathSize
+ {{ key }} + {{ key }}{{ value | filesizeformat(True) }}
{% elif files %}