From 1d6f6674564b9b0c44adbc7c93f0401d10b8fd8b Mon Sep 17 00:00:00 2001 From: Gregorio Litenstein Date: Tue, 16 Jul 2024 10:25:15 -0400 Subject: [PATCH] Fix a bug that would duplicate files. --- deluge/pluginmanagerbase.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deluge/pluginmanagerbase.py b/deluge/pluginmanagerbase.py index 3adbb11afd..75f4d307ca 100644 --- a/deluge/pluginmanagerbase.py +++ b/deluge/pluginmanagerbase.py @@ -205,7 +205,7 @@ def on_started(result, instance): ) self.config['enabled_plugins'].append(plugin_name_space) log.info('Plugin %s enabled...', plugin_name_space) - PluginResourceManager.prepare_for(plugin_name_space) + PluginResourceManager.prepare_for(instance.__module__) return True def on_started_error(result, instance): @@ -244,6 +244,7 @@ def disable_plugin(self, name): return defer.succeed(True) try: + module_name = self.plugins[name].__module__ d = defer.maybeDeferred(self.plugins[name].disable) except Exception as ex: log.error('Error when disabling plugin: %s', self.plugin._component_name) @@ -267,7 +268,7 @@ def on_disabled(result): ret = False else: log.info('Plugin %s disabled...', name) - PluginResourceManager.clear_for(name) + PluginResourceManager.clear_for(module_name) return ret d.addBoth(on_disabled)