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
@ -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…
x
Reference in New Issue
Block a user