From 0b6f6fd4ec80f8805cfa9135980903f3038f4c49 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 9 Jan 2011 13:41:35 +0100 Subject: closed #213, #212, #101 --- module/web/pyload/views.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'module/web/pyload') 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)): -- cgit v1.2.3