mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-25 09:35:16 +00:00
json,update_ui fix if label plugin not enabled
This commit is contained in:
parent
6a216c0122
commit
f7066242da
@ -135,10 +135,11 @@ class json_rpc:
|
|||||||
#Extra exposed methods:
|
#Extra exposed methods:
|
||||||
#
|
#
|
||||||
def system_listMethods(self):
|
def system_listMethods(self):
|
||||||
"system.list_methods() see json/xmlrpc docs"
|
"system.listMethods() see json/xmlrpc docs"
|
||||||
return sclient.list_methods() + self.json_exposed
|
return sclient.list_methods() + self.json_exposed
|
||||||
|
|
||||||
def get_stats(self):
|
def get_stats(self):
|
||||||
|
"returns global stats dict"
|
||||||
stats = {}
|
stats = {}
|
||||||
|
|
||||||
aclient.get_download_rate(dict_cb('download_rate',stats))
|
aclient.get_download_rate(dict_cb('download_rate',stats))
|
||||||
@ -160,12 +161,10 @@ class json_rpc:
|
|||||||
"""
|
"""
|
||||||
Composite call.
|
Composite call.
|
||||||
Goal : limit the number of ajax calls
|
Goal : limit the number of ajax calls
|
||||||
filter is only effective if the label plugin is enabled.
|
|
||||||
cache_id = future feature, not effective yet.
|
|
||||||
=== input ===
|
=== input ===
|
||||||
{{{
|
{{{
|
||||||
keys: see get_torrent_status
|
keys: see get_torrent_status
|
||||||
filter_dict: see label_get_filtered_ids
|
filter_dict: see label_get_filtered_ids # only effective if the label plugin is enabled.
|
||||||
cache_id: # todo
|
cache_id: # todo
|
||||||
}
|
}
|
||||||
}}}
|
}}}
|
||||||
@ -184,8 +183,8 @@ class json_rpc:
|
|||||||
torrent_ids = sclient.label_get_filtered_ids(filter_dict)
|
torrent_ids = sclient.label_get_filtered_ids(filter_dict)
|
||||||
filters = sclient.label_filter_items()
|
filters = sclient.label_filter_items()
|
||||||
else:
|
else:
|
||||||
torrent_ids = proxy.get_session_state()
|
torrent_ids = sclient.get_session_state()
|
||||||
organize_filters = {"state":[["All",-1]],"tracker":[]}
|
filters = {"state":[["All",-1]],"tracker":[],"label":[]}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"torrents":sclient.get_torrents_status(torrent_ids, keys),
|
"torrents":sclient.get_torrents_status(torrent_ids, keys),
|
||||||
@ -195,7 +194,6 @@ class json_rpc:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
component.get("PageManager").register_page("/json/rpc",json_rpc)
|
component.get("PageManager").register_page("/json/rpc",json_rpc)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user