Changeset d8746a


Ignore:
Timestamp:
01/26/2022 06:40:16 PM (3 years ago)
Author:
Calum Lind <calumlind+deluge@gmail.com>
Branches:
develop, master
Children:
87ec04
Parents:
7c9a54
git-author:
Chase Sterling <chase.sterling@gmail.com> (01/22/2022 03:06:32 AM)
git-committer:
Calum Lind <calumlind+deluge@gmail.com> (01/26/2022 06:40:16 PM)
Message:

[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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • deluge/core/core.py

    r7c9a54 rd8746a  
    764764
    765765    @export
     766    @defer.inlineCallbacks
    766767    def get_torrents_status(self, filter_dict, keys, diff=False):
    767768        """
    768769        returns all torrents , optionally filtered by filter_dict.
    769770        """
     771        all_keys = not keys
    770772        torrent_ids = self.filtermanager.filter_torrent_ids(filter_dict)
    771         d = self.torrentmanager.torrents_status_update(torrent_ids, keys, diff=diff)
    772 
    773         def add_plugin_fields(args):
    774             status_dict, plugin_keys = args
    775             # Ask the plugin manager to fill in the plugin keys
    776             if len(plugin_keys) > 0:
    777                 for key in status_dict:
    778                     status_dict[key].update(
    779                         self.pluginmanager.get_status(key, plugin_keys)
    780                     )
    781             return status_dict
    782 
    783         d.addCallback(add_plugin_fields)
    784         return d
     773        status_dict, plugin_keys = yield self.torrentmanager.torrents_status_update(
     774            torrent_ids, keys, diff=diff
     775        )
     776        # Ask the plugin manager to fill in the plugin keys
     777        if len(plugin_keys) > 0 or all_keys:
     778            for key in status_dict:
     779                status_dict[key].update(self.pluginmanager.get_status(key, plugin_keys))
     780        return status_dict
    785781
    786782    @export
Note: See TracChangeset for help on using the changeset viewer.