From 95d09b338ac7aed2b387bf143a5cfd1c4b29f612 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 15 Dec 2009 17:48:30 +0100 Subject: new Django webinterface(in development), small fixes --- module/web/pyload/views.py | 80 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 module/web/pyload/views.py (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py new file mode 100644 index 000000000..c42511ede --- /dev/null +++ b/module/web/pyload/views.py @@ -0,0 +1,80 @@ +# Create your views here. +from django.http import HttpResponse +from django.http import HttpResponseRedirect +from django.http import HttpResponseGone +from django.conf import settings +from django.shortcuts import render_to_response +from django.template import RequestContext +from django.contrib.auth.decorators import login_required +from os.path import join + + +def check_server(function): + def _dec(view_func): + def _view(request, *args, **kwargs): + try: + version = settings.PYLOAD.get_server_version() + return view_func(request, *args, **kwargs) + except Exception, e: + return base(request, messages=['Can\'t connect to pyLoad. Please check your configuration and make sure pyLoad is running.',str(e)]) + + _view.__name__ = view_func.__name__ + _view.__dict__ = view_func.__dict__ + _view.__doc__ = view_func.__doc__ + + return _view + + if function is None: + return _dec + else: + return _dec(function) + + +def permission(perm): + def _dec(view_func): + def _view(request, *args, **kwargs): + if request.user.has_perm(perm): + return view_func(request, *args, **kwargs) + else: + return base(request, messages=['You don\'t have permission to view this page.']) + + _view.__name__ = view_func.__name__ + _view.__dict__ = view_func.__dict__ + _view.__doc__ = view_func.__doc__ + + return _view + + return _dec + + +def base(request, messages): + return render_to_response(join(settings.TEMPLATE,'base.html'), {'messages': messages},RequestContext(request)) + +@login_required +#@permission('perm.permissions.can_see_dl') @TODO: Permissions not working :( +@check_server +def home(request): + return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request)) + + +@login_required +#@permission('pyload.perm.can_see_dl') +@check_server +def queue(request): + return render_to_response(join(settings.TEMPLATE,'queue.html'), RequestContext(request)) + + +@login_required +#@permission('pyload.user.can_download') +@check_server +def downloads(request): + return render_to_response(join(settings.TEMPLATE,'downloads.html'), RequestContext(request)) + + +@login_required +#@permission('pyload.user.can_see_logs') +@check_server +def logs(request): + return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request)) + + \ No newline at end of file -- cgit v1.2.3 From fe85f003f3adfb568c8b1a650035128c183a739d Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 16 Dec 2009 17:09:14 +0100 Subject: some Webinterface Json Code --- module/web/pyload/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index c42511ede..6c2954555 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -1,7 +1,6 @@ # Create your views here. from django.http import HttpResponse from django.http import HttpResponseRedirect -from django.http import HttpResponseGone from django.conf import settings from django.shortcuts import render_to_response from django.template import RequestContext @@ -14,9 +13,9 @@ def check_server(function): def _view(request, *args, **kwargs): try: version = settings.PYLOAD.get_server_version() - return view_func(request, *args, **kwargs) except Exception, e: return base(request, messages=['Can\'t connect to pyLoad. Please check your configuration and make sure pyLoad is running.',str(e)]) + return view_func(request, *args, **kwargs) _view.__name__ = view_func.__name__ _view.__dict__ = view_func.__dict__ @@ -54,6 +53,7 @@ def base(request, messages): #@permission('perm.permissions.can_see_dl') @TODO: Permissions not working :( @check_server def home(request): + print request.user.get_all_permissions() return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request)) -- cgit v1.2.3 From 3db583f5f10a72e53ecd8d282ec5db1e3f4cd4dd Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 16 Dec 2009 22:49:20 +0100 Subject: Webinterface authsystem --- module/web/pyload/views.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 6c2954555..405bd2753 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -50,29 +50,28 @@ def base(request, messages): return render_to_response(join(settings.TEMPLATE,'base.html'), {'messages': messages},RequestContext(request)) @login_required -#@permission('perm.permissions.can_see_dl') @TODO: Permissions not working :( +@permission('pyload.can_see_dl') @check_server def home(request): - print request.user.get_all_permissions() return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request)) @login_required -#@permission('pyload.perm.can_see_dl') +@permission('pyload.can_see_dl') @check_server def queue(request): return render_to_response(join(settings.TEMPLATE,'queue.html'), RequestContext(request)) @login_required -#@permission('pyload.user.can_download') +@permission('pyload.can_download') @check_server def downloads(request): return render_to_response(join(settings.TEMPLATE,'downloads.html'), RequestContext(request)) @login_required -#@permission('pyload.user.can_see_logs') +@permission('pyload.user.can_see_logs') @check_server def logs(request): return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request)) -- cgit v1.2.3 From 511ae48877f8f3fae2a3ba282d979c33f2ea5491 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 17 Dec 2009 16:14:26 +0100 Subject: webinterface: config working, downloadable files --- module/web/pyload/views.py | 67 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 5 deletions(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 405bd2753..0cdc87873 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -1,11 +1,17 @@ # Create your views here. +import mimetypes from django.http import HttpResponse from django.http import HttpResponseRedirect +from django.http import HttpResponseNotFound from django.conf import settings from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth.decorators import login_required from os.path import join +from os.path import isdir +from os.path import isfile +from os import listdir +from os import stat def check_server(function): @@ -67,13 +73,64 @@ def queue(request): @permission('pyload.can_download') @check_server def downloads(request): - return render_to_response(join(settings.TEMPLATE,'downloads.html'), RequestContext(request)) - + if not isdir(settings.DL_ROOT): + return base(request, ['Download directory not found.']) + data = { + 'folder': [], + 'files': [] + } + + for item in listdir(settings.DL_ROOT): + if isdir(join(settings.DL_ROOT, item)): + folder = { + 'name' : item, + 'files' : [] + } + for file in listdir(join(settings.DL_ROOT, item)): + if isfile(join(settings.DL_ROOT, item, file)): + folder['files'].append(file) + + data['folder'].append(folder) + elif isfile(join(settings.DL_ROOT, item)): + data['files'].append(item) + + + return render_to_response(join(settings.TEMPLATE,'downloads.html'), {'files': data}, RequestContext(request)) + +@login_required +@permission('pyload.user.can_download') +@check_server +def download(request,path): + path = path.split("/") + + dir = join(settings.DL_ROOT, path[1].replace('..','')) + if isdir(dir) or isfile(dir): + if isdir(dir): filepath = join(dir, path[2]) + elif isfile(dir): filepath = dir + + print filepath + if isfile(filepath): + try: + type, encoding = mimetypes.guess_type(filepath) + if type is None: + type = 'application/octet-stream' + + response = HttpResponse(mimetype=type) + response['Content-Length'] = str(stat(filepath).st_size) + + if encoding is not None: + response['Content-Encoding'] = encoding + + response.write(file(filepath, "rb").read()) + return response + + except Exception, e: + return HttpResponseNotFound("File not Found. %s" % str(e)) + + return HttpResponseNotFound("File not Found.") @login_required @permission('pyload.user.can_see_logs') @check_server def logs(request): - return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request)) - - \ No newline at end of file + return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request)) \ No newline at end of file -- cgit v1.2.3 From 1d7dc2ca5db0119e01547cd7b01fb77720450d1c Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 19 Dec 2009 00:26:38 +0100 Subject: cleaned --- module/web/pyload/views.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 0cdc87873..904e312e7 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -1,7 +1,6 @@ # Create your views here. import mimetypes from django.http import HttpResponse -from django.http import HttpResponseRedirect from django.http import HttpResponseNotFound from django.conf import settings from django.shortcuts import render_to_response -- cgit v1.2.3 From adcc953b4dd2dce1f91bd7cd11105e9f0653f704 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 19 Dec 2009 15:13:10 +0100 Subject: fixed reconnect --- module/web/pyload/views.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 904e312e7..a51a9c4dc 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -51,6 +51,11 @@ def permission(perm): return _dec + +def status_proc(request): + return {'status': settings.PYLOAD.status_server()} + + def base(request, messages): return render_to_response(join(settings.TEMPLATE,'base.html'), {'messages': messages},RequestContext(request)) @@ -58,14 +63,14 @@ def base(request, messages): @permission('pyload.can_see_dl') @check_server def home(request): - return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request)) + return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request,{},[status_proc])) @login_required @permission('pyload.can_see_dl') @check_server def queue(request): - return render_to_response(join(settings.TEMPLATE,'queue.html'), RequestContext(request)) + return render_to_response(join(settings.TEMPLATE,'queue.html'), RequestContext(request,{},[status_proc])) @login_required @@ -94,7 +99,7 @@ def downloads(request): data['files'].append(item) - return render_to_response(join(settings.TEMPLATE,'downloads.html'), {'files': data}, RequestContext(request)) + return render_to_response(join(settings.TEMPLATE,'downloads.html'), RequestContext(request,{'files': data},[status_proc])) @login_required @permission('pyload.user.can_download') @@ -132,4 +137,4 @@ def download(request,path): @permission('pyload.user.can_see_logs') @check_server def logs(request): - return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request)) \ No newline at end of file + return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request,{},[status_proc])) \ No newline at end of file -- cgit v1.2.3 From 62965d0668e81fc801c4be2d61c1a0b64b0edca8 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 20 Dec 2009 23:43:21 +0100 Subject: cli + web fixes --- module/web/pyload/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index a51a9c4dc..1fa9d45b7 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -63,7 +63,7 @@ def base(request, messages): @permission('pyload.can_see_dl') @check_server def home(request): - return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request,{},[status_proc])) + return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request,{'content': settings.PYLOAD.status_downloads()},[status_proc])) @login_required -- cgit v1.2.3 From 9453269684b8d17411d8bbc4ecd0c7958670ff42 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 21 Dec 2009 19:59:59 +0100 Subject: log view, progressbar test --- module/web/pyload/views.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 1fa9d45b7..e38a0abf5 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Create your views here. import mimetypes from django.http import HttpResponse @@ -136,5 +138,12 @@ def download(request,path): @login_required @permission('pyload.user.can_see_logs') @check_server -def logs(request): - return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request,{},[status_proc])) \ No newline at end of file +def logs(request, page=0): + + log = file(join(settings.LOG_ROOT, "log.txt")).readlines() + data = [] + page = int(page) + for i in range(page, page+20): + data.append({'line': i+1 , 'content' :log[i]}) + + return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request,{'log': data, 'next': str(page+20) , 'prev': 0 if page-20 < 0 else page-20},[status_proc])) \ No newline at end of file -- cgit v1.2.3 From 3d655ddbfbd96abecb9a9c9bebf6e43eb710ab12 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 10 Jan 2010 16:20:31 +0100 Subject: fixed manage.py, addBox working, some code formatted and cleaned --- module/web/pyload/views.py | 49 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index e38a0abf5..35d777020 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -2,27 +2,28 @@ # Create your views here. import mimetypes +from os import listdir +from os import stat +from os.path import isdir +from os.path import isfile +from os.path import join + +from django.conf import settings +from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.http import HttpResponseNotFound -from django.conf import settings from django.shortcuts import render_to_response from django.template import RequestContext -from django.contrib.auth.decorators import login_required -from os.path import join -from os.path import isdir -from os.path import isfile -from os import listdir -from os import stat def check_server(function): def _dec(view_func): - def _view(request, *args, **kwargs): + def _view(request, * args, ** kwargs): try: version = settings.PYLOAD.get_server_version() except Exception, e: - return base(request, messages=['Can\'t connect to pyLoad. Please check your configuration and make sure pyLoad is running.',str(e)]) - return view_func(request, *args, **kwargs) + return base(request, messages=['Can\'t connect to pyLoad. Please check your configuration and make sure pyLoad is running.', str(e)]) + return view_func(request, * args, ** kwargs) _view.__name__ = view_func.__name__ _view.__dict__ = view_func.__dict__ @@ -38,9 +39,9 @@ def check_server(function): def permission(perm): def _dec(view_func): - def _view(request, *args, **kwargs): + def _view(request, * args, ** kwargs): if request.user.has_perm(perm): - return view_func(request, *args, **kwargs) + return view_func(request, * args, ** kwargs) else: return base(request, messages=['You don\'t have permission to view this page.']) @@ -59,20 +60,20 @@ def status_proc(request): def base(request, messages): - return render_to_response(join(settings.TEMPLATE,'base.html'), {'messages': messages},RequestContext(request)) + return render_to_response(join(settings.TEMPLATE, 'base.html'), {'messages': messages}, RequestContext(request)) @login_required @permission('pyload.can_see_dl') @check_server def home(request): - return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request,{'content': settings.PYLOAD.status_downloads()},[status_proc])) + return render_to_response(join(settings.TEMPLATE, 'home.html'), RequestContext(request, {'content': settings.PYLOAD.status_downloads()}, [status_proc])) @login_required @permission('pyload.can_see_dl') @check_server def queue(request): - return render_to_response(join(settings.TEMPLATE,'queue.html'), RequestContext(request,{},[status_proc])) + return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {}, [status_proc])) @login_required @@ -89,8 +90,8 @@ def downloads(request): for item in listdir(settings.DL_ROOT): if isdir(join(settings.DL_ROOT, item)): folder = { - 'name' : item, - 'files' : [] + 'name': item, + 'files': [] } for file in listdir(join(settings.DL_ROOT, item)): if isfile(join(settings.DL_ROOT, item, file)): @@ -101,15 +102,15 @@ def downloads(request): data['files'].append(item) - return render_to_response(join(settings.TEMPLATE,'downloads.html'), RequestContext(request,{'files': data},[status_proc])) + return render_to_response(join(settings.TEMPLATE, 'downloads.html'), RequestContext(request, {'files': data}, [status_proc])) @login_required @permission('pyload.user.can_download') @check_server -def download(request,path): +def download(request, path): path = path.split("/") - dir = join(settings.DL_ROOT, path[1].replace('..','')) + dir = join(settings.DL_ROOT, path[1].replace('..', '')) if isdir(dir) or isfile(dir): if isdir(dir): filepath = join(dir, path[2]) elif isfile(dir): filepath = dir @@ -125,7 +126,7 @@ def download(request,path): response['Content-Length'] = str(stat(filepath).st_size) if encoding is not None: - response['Content-Encoding'] = encoding + response['Content-Encoding'] = encoding response.write(file(filepath, "rb").read()) return response @@ -143,7 +144,7 @@ def logs(request, page=0): log = file(join(settings.LOG_ROOT, "log.txt")).readlines() data = [] page = int(page) - for i in range(page, page+20): - data.append({'line': i+1 , 'content' :log[i]}) + for i in range(page, page + 20): + data.append({'line': i + 1, 'content':log[i]}) - return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request,{'log': data, 'next': str(page+20) , 'prev': 0 if page-20 < 0 else page-20},[status_proc])) \ No newline at end of file + return render_to_response(join(settings.TEMPLATE, 'logs.html'), RequestContext(request, {'log': data, 'next': str(page + 20), 'prev': 0 if page-20 < 0 else page-20}, [status_proc])) \ No newline at end of file -- cgit v1.2.3 From 9bff9c69d6983dc190c189647821e12d0f134883 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 11 Jan 2010 22:16:31 +0100 Subject: finally and officially: webinterface home page working ;) --- module/web/pyload/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 35d777020..a28b71e69 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -40,7 +40,7 @@ def check_server(function): def permission(perm): def _dec(view_func): def _view(request, * args, ** kwargs): - if request.user.has_perm(perm): + if request.user.has_perm(perm) and request.user.is_authenticated(): return view_func(request, * args, ** kwargs) else: return base(request, messages=['You don\'t have permission to view this page.']) -- cgit v1.2.3 From 36ed6c373b8dfde42f81e28d62c540aba5a3c04d Mon Sep 17 00:00:00 2001 From: mkaay Date: Wed, 13 Jan 2010 21:12:24 +0100 Subject: queue template + view --- module/web/pyload/views.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index a28b71e69..55887d711 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -73,7 +73,13 @@ def home(request): @permission('pyload.can_see_dl') @check_server def queue(request): - return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {}, [status_proc])) + queue = settings.PYLOAD.get_queue() + for pack in queue: + children = [] + for child in settings.PYLOAD.get_package_files(pack["id"]): + children.append(settings.PYLOAD.get_file_info()) + pack["children"] = children + return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {'content': queue}, [status_proc])) @login_required @@ -147,4 +153,4 @@ def logs(request, page=0): for i in range(page, page + 20): data.append({'line': i + 1, 'content':log[i]}) - return render_to_response(join(settings.TEMPLATE, 'logs.html'), RequestContext(request, {'log': data, 'next': str(page + 20), 'prev': 0 if page-20 < 0 else page-20}, [status_proc])) \ No newline at end of file + return render_to_response(join(settings.TEMPLATE, 'logs.html'), RequestContext(request, {'log': data, 'next': str(page + 20), 'prev': 0 if page-20 < 0 else page-20}, [status_proc])) -- cgit v1.2.3 From 8fd337815ce73a3b44dc0fa0a913c3d3efea09bb Mon Sep 17 00:00:00 2001 From: mkaay Date: Wed, 13 Jan 2010 21:22:29 +0100 Subject: fix --- module/web/pyload/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 55887d711..994075001 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -77,7 +77,7 @@ def queue(request): for pack in queue: children = [] for child in settings.PYLOAD.get_package_files(pack["id"]): - children.append(settings.PYLOAD.get_file_info()) + children.append(settings.PYLOAD.get_file_info(child)) pack["children"] = children return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {'content': queue}, [status_proc])) -- cgit v1.2.3 From 07f280a220ab5bc5c3fb510ea00aecedfcec7564 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 20 Jan 2010 19:41:43 +0100 Subject: queue page fully functional, some fixes --- module/web/pyload/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 994075001..d72dca56c 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -111,7 +111,7 @@ def downloads(request): return render_to_response(join(settings.TEMPLATE, 'downloads.html'), RequestContext(request, {'files': data}, [status_proc])) @login_required -@permission('pyload.user.can_download') +@permission('pyload.can_download') @check_server def download(request, path): path = path.split("/") @@ -143,7 +143,7 @@ def download(request, path): return HttpResponseNotFound("File not Found.") @login_required -@permission('pyload.user.can_see_logs') +@permission('pyload.can_see_logs') @check_server def logs(request, page=0): -- cgit v1.2.3 From 9aa8ca3b24133bef767f0eb8508e276fa7f92ee9 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 23 Jan 2010 15:51:19 +0100 Subject: added missing icons, final improvments --- module/web/pyload/views.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index d72dca56c..ea9d5f1be 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -75,10 +75,7 @@ def home(request): def queue(request): queue = settings.PYLOAD.get_queue() for pack in queue: - children = [] - for child in settings.PYLOAD.get_package_files(pack["id"]): - children.append(settings.PYLOAD.get_file_info(child)) - pack["children"] = children + pack["children"] = map(settings.PYLOAD.get_file_info, settings.PYLOAD.get_package_files(pack["id"])) return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {'content': queue}, [status_proc])) -- cgit v1.2.3