diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-01-09 13:41:35 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-01-09 13:41:35 +0100 |
commit | 0b6f6fd4ec80f8805cfa9135980903f3038f4c49 (patch) | |
tree | 7989f1d540d630e629844329817330d5f10d6068 /module/web | |
parent | encoding fix (diff) | |
download | pyload-0b6f6fd4ec80f8805cfa9135980903f3038f4c49.tar.xz |
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/pyload/views.py | 11 |
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)): |