diff --git a/deluge/core/core.py b/deluge/core/core.py index d70160759..6537ce379 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -113,6 +113,8 @@ class Core(component.Component): # Get the core config self.config = deluge.configmanager.ConfigManager("core.conf") + self.config.run_converter((0, 1), 2, self.__migrate_config_1_to_2) + self.config.save() # If there was an interface value from the command line, use it, but # store the one in the config so we can restore it on shutdown @@ -159,6 +161,12 @@ class Core(component.Component): except Exception, e: log.warning("Failed to load lt state: %s", e) + + def __migrate_config_1_to_2(self, config): + if 'sequential_download' not in config: + config['sequential_download'] = False + return config + def save_dht_state(self): """Saves the dht state to a file""" try: diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py index 76b1d41c2..d42be335c 100644 --- a/deluge/core/preferencesmanager.py +++ b/deluge/core/preferencesmanager.py @@ -154,7 +154,6 @@ class PreferencesManager(component.Component): "attribute to shared.") self.config["shared"] = self.config["public"] del self.config["public"] - self.config.run_converter((0, 1), 2, self.__migrate_config_1_to_2) def start(self): self.core = component.get("Core") @@ -474,8 +473,3 @@ class PreferencesManager(component.Component): def _on_set_cache_expiry(self, key, value): log.debug("%s: %s", key, value) self.session_set_setting("cache_expiry", value) - - def __migrate_config_1_to_2(self, config): - if 'sequential_download' not in config: - config['sequential_download'] = DEFAULT_PREFS['sequential_download'] - return config