json:add get_stats method
This commit is contained in:
parent
e2bc3dbd48
commit
59a7d8b947
|
@ -56,7 +56,6 @@ function list_torrents() {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
function update_torrent(torrent) {
|
function update_torrent(torrent) {
|
||||||
alert(torrent.name);
|
alert(torrent.name);
|
||||||
};
|
};
|
||||||
|
|
|
@ -87,36 +87,13 @@ def self_url(**kwargs):
|
||||||
return config["base"] + changequery(**kwargs)
|
return config["base"] + changequery(**kwargs)
|
||||||
|
|
||||||
def do_redirect():
|
def do_redirect():
|
||||||
"""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
|
||||||
|
#default:
|
||||||
#for the filters:
|
seeother('/index')
|
||||||
if ("order" in ck and "sort" in ck):
|
|
||||||
url_vars.update({'sort':ck['sort'] ,'order':ck['order'] })
|
|
||||||
|
|
||||||
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…
Reference in New Issue