mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Apply the global bandwidth settings on plugin disable to prevent slow limits from staying in effect.
This commit is contained in:
parent
d4c7134746
commit
ef3b22691b
1 changed files with 14 additions and 6 deletions
|
@ -96,10 +96,23 @@ class Core(CorePluginBase):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
self.__apply_set_functions()
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def __apply_set_functions(self):
|
||||||
|
"""
|
||||||
|
Have the core apply it's bandwidth settings as specified in core.conf.
|
||||||
|
"""
|
||||||
|
core_config = deluge.configmanager.ConfigManager("core.conf")
|
||||||
|
core_config.apply_set_functions("max_download_speed")
|
||||||
|
core_config.apply_set_functions("max_upload_speed")
|
||||||
|
core_config.apply_set_functions("max_active_limit")
|
||||||
|
# Resume the session if necessary
|
||||||
|
component.get("Core").session.resume()
|
||||||
|
|
||||||
def do_schedule(self, timer=True):
|
def do_schedule(self, timer=True):
|
||||||
"""
|
"""
|
||||||
This is where we apply schedule rules.
|
This is where we apply schedule rules.
|
||||||
|
@ -110,12 +123,7 @@ class Core(CorePluginBase):
|
||||||
if state == "Green":
|
if state == "Green":
|
||||||
# This is Green (Normal) so we just make sure we've applied the
|
# This is Green (Normal) so we just make sure we've applied the
|
||||||
# global defaults
|
# global defaults
|
||||||
core_config = deluge.configmanager.ConfigManager("core.conf")
|
self.__apply_set_functions()
|
||||||
core_config.apply_set_functions("max_download_speed")
|
|
||||||
core_config.apply_set_functions("max_upload_speed")
|
|
||||||
core_config.apply_set_functions("max_active_limit")
|
|
||||||
# Resume the session if necessary
|
|
||||||
component.get("Core").session.resume()
|
|
||||||
elif state == "Yellow":
|
elif state == "Yellow":
|
||||||
# This is Yellow (Slow), so use the settings provided from the user
|
# This is Yellow (Slow), so use the settings provided from the user
|
||||||
session = component.get("Core").session
|
session = component.get("Core").session
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue