mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
json:add get_stats method
This commit is contained in:
parent
6f87ba0646
commit
e2bc3dbd48
1 changed files with 26 additions and 8 deletions
|
@ -87,18 +87,36 @@ def self_url(**kwargs):
|
||||||
return config["base"] + changequery(**kwargs)
|
return config["base"] + changequery(**kwargs)
|
||||||
|
|
||||||
def do_redirect():
|
def do_redirect():
|
||||||
import render
|
"""for redirects after a POST"""
|
||||||
"""go to /index unless the redir var is set."""
|
vars = web.input(redir = None)
|
||||||
vars = web.input(redir=None)
|
ck = cookies()
|
||||||
|
url_vars = {}
|
||||||
|
|
||||||
if vars.redir:
|
if vars.redir:
|
||||||
w_seeother(vars.redir) #redir variable contains base
|
w_seeother(vars.redir) #redir variable contains base
|
||||||
return
|
return
|
||||||
|
|
||||||
#test-alt-home
|
#for the filters:
|
||||||
if hasattr(render,"home"):
|
if ("order" in ck and "sort" in ck):
|
||||||
return render.home()
|
url_vars.update({'sort':ck['sort'] ,'order':ck['order'] })
|
||||||
#default:
|
|
||||||
seeother('/index')
|
organize = False
|
||||||
|
try:
|
||||||
|
organize = ('Organize' in sclient.get_enabled_plugins())
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if organize:
|
||||||
|
#todo:DRY
|
||||||
|
if ("state" in ck) and ck['state']:
|
||||||
|
url_vars['state'] = ck['state']
|
||||||
|
if ("tracker" in ck) and ck['tracker']:
|
||||||
|
url_vars['tracker'] = ck['tracker']
|
||||||
|
if ("keyword" in ck) and ck['keyword']:
|
||||||
|
url_vars['keyword'] = ck['keyword']
|
||||||
|
|
||||||
|
#redirect.
|
||||||
|
w_seeother(url("/index", **url_vars))
|
||||||
|
|
||||||
def getcookie(key, default = None):
|
def getcookie(key, default = None):
|
||||||
"because i'm too lazy to type 3 lines for something this simple"
|
"because i'm too lazy to type 3 lines for something this simple"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue