mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
enable queue
This commit is contained in:
parent
d2bd2fabcf
commit
f0d52b4fda
1 changed files with 15 additions and 27 deletions
|
@ -228,7 +228,7 @@ class torrent_info_inner:
|
||||||
setcookie("torrent_info_tab", active_tab)
|
setcookie("torrent_info_tab", active_tab)
|
||||||
return render.torrent_info_inner(torrent, active_tab)
|
return render.torrent_info_inner(torrent, active_tab)
|
||||||
|
|
||||||
#next 4 classes: a pattern is emerging here.
|
#next 6 classes: a pattern is emerging here.
|
||||||
#todo: DRY (in less lines of code)
|
#todo: DRY (in less lines of code)
|
||||||
#deco.deluge_command, or a subclass?
|
#deco.deluge_command, or a subclass?
|
||||||
class torrent_start:
|
class torrent_start:
|
||||||
|
@ -259,6 +259,20 @@ class torrent_recheck:
|
||||||
proxy.force_recheck(torrent_ids)
|
proxy.force_recheck(torrent_ids)
|
||||||
do_redirect()
|
do_redirect()
|
||||||
|
|
||||||
|
class torrent_queue_up:
|
||||||
|
@deco.check_session
|
||||||
|
@deco.torrent_ids
|
||||||
|
def POST(self, torrent_ids):
|
||||||
|
proxy.queue_up(torrent_ids)
|
||||||
|
do_redirect()
|
||||||
|
|
||||||
|
class torrent_queue_down:
|
||||||
|
@deco.check_session
|
||||||
|
@deco.torrent_ids
|
||||||
|
def POST(self, torrent_ids):
|
||||||
|
proxy.queue_down(torrent_ids)
|
||||||
|
do_redirect()
|
||||||
|
|
||||||
class torrent_delete:
|
class torrent_delete:
|
||||||
@deco.deluge_page
|
@deco.deluge_page
|
||||||
@deco.torrent_list
|
@deco.torrent_list
|
||||||
|
@ -276,32 +290,6 @@ class torrent_delete:
|
||||||
proxy.remove_torrent(torrent_ids, torrent_also, data_also)
|
proxy.remove_torrent(torrent_ids, torrent_also, data_also)
|
||||||
do_redirect()
|
do_redirect()
|
||||||
|
|
||||||
class torrent_queue_up:
|
|
||||||
@deco.check_session
|
|
||||||
@deco.torrent_list
|
|
||||||
def POST(self, torrent_list):
|
|
||||||
return error_page('Queue is broken, we know about it.')
|
|
||||||
#a bit too verbose..
|
|
||||||
torrent_list.sort(lambda x, y : x.queue - y.queue)
|
|
||||||
torrent_ids = [t.id for t in torrent_list]
|
|
||||||
for torrent_id in torrent_ids:
|
|
||||||
#async_proxy.get_core().call("queue_queue_up", None, torrent_id)
|
|
||||||
async_proxy.queue_queue_up(None, torrent_id)
|
|
||||||
do_redirect()
|
|
||||||
|
|
||||||
class torrent_queue_down:
|
|
||||||
@deco.check_session
|
|
||||||
@deco.torrent_list
|
|
||||||
def POST(self, torrent_list):
|
|
||||||
return error_page('Queue is broken, we know about it.')
|
|
||||||
#a bit too verbose..
|
|
||||||
torrent_list.sort(lambda x, y : x.queue - y.queue)
|
|
||||||
torrent_ids = [t.id for t in torrent_list]
|
|
||||||
for torrent_id in reversed(torrent_ids):
|
|
||||||
#async_proxy.get_core().call("queue_queue_down", None, torrent_id)
|
|
||||||
async_proxy.queue_queue_down(None, torrent_id)
|
|
||||||
do_redirect()
|
|
||||||
|
|
||||||
class torrent_files:
|
class torrent_files:
|
||||||
@deco.check_session
|
@deco.check_session
|
||||||
def POST(self, torrent_id):
|
def POST(self, torrent_id):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue