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 @@
-
-
- Path |
- Size |
-
-
- {%- for key, value in files.items() %}
-
- {{ key }} |
- {{ value | filesizeformat(True) }} |
-
- {%- endfor %}
-
-
+
+
+ Path |
+ Size |
+
+
+ {%- for key, value in files.items() recursive %}
+
+ {%- if value is iterable %}
+
+ {{ key }} |
+ {{ loop(value.items()) }}
+ {%- else %}
+
+ {{ key }} |
+ {{ value | filesizeformat(True) }} |
+ {%- endif %}
+
+ {%- endfor %}
+
{% elif files %}