summaryrefslogtreecommitdiffstats
path: root/module/web/ajax
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-09-14 14:07:49 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-09-14 14:07:49 +0200
commit71467f2866e96cdbe911cd9996305b7e83eef2a2 (patch)
treee72c3fb58981533f3740a736947840a5cc7a3ed5 /module/web/ajax
parentreverted, closed #129 (diff)
downloadpyload-71467f2866e96cdbe911cd9996305b7e83eef2a2.tar.xz
link ordering for webif
Diffstat (limited to 'module/web/ajax')
-rw-r--r--module/web/ajax/urls.py3
-rw-r--r--module/web/ajax/views.py15
2 files changed, 15 insertions, 3 deletions
diff --git a/module/web/ajax/urls.py b/module/web/ajax/urls.py
index 07b5683b6..a88e3aea5 100644
--- a/module/web/ajax/urls.py
+++ b/module/web/ajax/urls.py
@@ -26,7 +26,8 @@ urlpatterns = patterns('ajax',
(r'^restart_package/(\d+)$', 'views.restart_package'),
(r'^remove_link/(\d+)$', 'views.remove_link'),
(r'^restart_link/(\d+)$', 'views.restart_link'),
- (r'^push_to_queue/(\d+)$', 'views.push_to_queue'),
+ (r'^move_package/(\d+)/(\d+)$', 'views.move_package'),
(r'^set_captcha$', 'views.set_captcha'),
(r'^package_order/([0-9|]+)$', 'views.package_order'),
+ (r'^link_order/([0-9|]+)$', 'views.link_order'),
) \ No newline at end of file
diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py
index f020a8303..f96b93b70 100644
--- a/module/web/ajax/views.py
+++ b/module/web/ajax/views.py
@@ -216,6 +216,17 @@ def package_order(request, ids):
except:
print_exc()
return HttpResponseServerError()
+
+@permission('pyload.can_add_dl')
+def link_order(request, ids):
+ try:
+ pid, pos = ids.split("|")
+ settings.PYLOAD.order_file(int(pid), int(pos))
+ return JsonResponse("sucess")
+ except:
+ print_exc()
+ return HttpResponseServerError()
+
@permission('pyload.can_see_dl')
def link(request, id):
try:
@@ -259,9 +270,9 @@ def abort_link(request, id):
return HttpResponseServerError()
@permission('pyload.can_add_dl')
-def push_to_queue(request, id):
+def move_package(request, dest, id):
try:
- settings.PYLOAD.push_package_to_queue(int(id))
+ settings.PYLOAD.move_package(int(dest), int(id))
return JsonResponse("sucess")
except:
return HttpResponseServerError()