summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChase Sterling <chase.sterling@gmail.com>2022-01-21 22:06:32 -0500
committerCalum Lind <calumlind+deluge@gmail.com>2022-01-26 18:40:16 +0000
commitd8746a88526bb059d45b89ce1daeb7cf4c58d0b9 (patch)
tree3a8facf5aefe0df57a71cfa7d77466af16c81110
parent7c9a542006d82880011ff33de22c6db947019340 (diff)
downloaddeluge-d8746a88526bb059d45b89ce1daeb7cf4c58d0b9.tar.gz
deluge-d8746a88526bb059d45b89ce1daeb7cf4c58d0b9.tar.bz2
deluge-d8746a88526bb059d45b89ce1daeb7cf4c58d0b9.zip
[Core] Return plugin keys with get_torrents_status
When requesting all keys, get_torrents_status was missing plugin added keys This commit brings the behavior in line with get_torrent_status, and deluge 1.3 Closes: https://dev.deluge-torrent.org/ticket/3357 Closes: https://github.com/deluge-torrent/deluge/pull/347
-rw-r--r--deluge/core/core.py24
1 files changed, 10 insertions, 14 deletions
diff --git a/deluge/core/core.py b/deluge/core/core.py
index 0563318a5..a763b8d2f 100644
--- a/deluge/core/core.py
+++ b/deluge/core/core.py
@@ -763,25 +763,21 @@ class Core(component.Component):
)
@export
+ @defer.inlineCallbacks
def get_torrents_status(self, filter_dict, keys, diff=False):
"""
returns all torrents , optionally filtered by filter_dict.
"""
+ all_keys = not keys
torrent_ids = self.filtermanager.filter_torrent_ids(filter_dict)
- d = self.torrentmanager.torrents_status_update(torrent_ids, keys, diff=diff)
-
- def add_plugin_fields(args):
- status_dict, plugin_keys = args
- # Ask the plugin manager to fill in the plugin keys
- if len(plugin_keys) > 0:
- for key in status_dict:
- status_dict[key].update(
- self.pluginmanager.get_status(key, plugin_keys)
- )
- return status_dict
-
- d.addCallback(add_plugin_fields)
- return d
+ status_dict, plugin_keys = yield self.torrentmanager.torrents_status_update(
+ torrent_ids, keys, diff=diff
+ )
+ # Ask the plugin manager to fill in the plugin keys
+ if len(plugin_keys) > 0 or all_keys:
+ for key in status_dict:
+ status_dict[key].update(self.pluginmanager.get_status(key, plugin_keys))
+ return status_dict
@export
def get_filter_tree(self, show_zero_hits=True, hide_cat=None):