Ticket #2257: support-libtorrent0.16.6-active_X_limit-settings-branch-master.diff

File support-libtorrent0.16.6-active_X_limit-settings-branch-master.diff, 1.9 KB (added by Chionsas, 8 years ago)

no spaces in diff filename

  • deluge/core/preferencesmanager.py

    diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py
    index 9035655..dd20a7a 100644
    a b  
    9090    "max_active_seeding": 5, 
    9191    "max_active_downloading": 3, 
    9292    "max_active_limit": 8, 
     93    "max_active_dht_limit": -1, 
     94    "max_active_tracker_limit": -1, 
     95    "max_active_lsd_limit": -1, 
    9396    "dont_count_slow_torrents": False, 
    9497    "queue_new_to_top": False, 
    9598    "stop_seed_at_ratio": False, 
    def _on_set_max_active_limit(self, key, value): 
    383386        log.debug("%s set to %s..", key, value) 
    384387        self.session_set_setting("active_limit", value) 
    385388 
     389    def _on_set_max_active_dht_limit(self, key, value): 
     390        log.debug("%s set to %s..", key, value) 
     391        # libtorrent does not accept -1 for active_dht_limit, 
     392        # so max(32-bit signed int) is passed for unlimited 
     393        if (value == -1): 
     394            value = 2147483647 
     395        self.session_set_setting("active_dht_limit", value) 
     396 
     397    def _on_set_max_active_tracker_limit(self, key, value): 
     398        log.debug("%s set to %s..", key, value) 
     399        # libtorrent does not accept -1 for active_tracker_limit, 
     400        # so max(32-bit signed int) is passed for unlimited 
     401        if (value == -1): 
     402            value = 2147483647 
     403        self.session_set_setting("active_tracker_limit", value) 
     404 
     405    def _on_set_max_active_lsd_limit(self, key, value): 
     406        log.debug("%s set to %s..", key, value) 
     407        # libtorrent does not accept -1 for active_lsd_limit, 
     408        # so max(32-bit signed int) is passed for unlimited 
     409        if (value == -1): 
     410            value = 2147483647 
     411        self.session_set_setting("active_lsd_limit", value) 
     412 
    386413    def _on_set_dont_count_slow_torrents(self, key, value): 
    387414        log.debug("%s set to %s..", key, value) 
    388415        self.session_set_setting("dont_count_slow_torrents", value)