summaryrefslogtreecommitdiffstats
path: root/module/web/pyload/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/pyload/views.py')
-rw-r--r--module/web/pyload/views.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py
index 29ad90867..76f991921 100644
--- a/module/web/pyload/views.py
+++ b/module/web/pyload/views.py
@@ -145,16 +145,19 @@ def downloads(request):
'files': []
}
- for item in listdir(root):
+ for item in sorted(listdir(root)):
if isdir(join(root, item)):
folder = {
'name': item,
'path': item,
'files': []
}
- for file in listdir(join(root, item)):
- if isfile(join(root, item, file)):
- folder['files'].append(file)
+ for file in sorted(listdir(join(root, item))):
+ try:
+ if isfile(join(root, item, file)):
+ folder['files'].append(file)
+ except:
+ pass
data['folder'].append(folder)
elif isfile(join(root, item)):