json,update_ui fix if label plugin not enabled

This commit is contained in:
Martijn Voncken 2008-07-15 17:50:12 +00:00
parent 6a216c0122
commit f7066242da

View File

@ -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)