From a2c87e1b7d4af76ac33ebde1424c7ecbe8584f35 Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Sat, 8 Feb 2014 03:22:59 +1300 Subject: [PATCH] Fixed bug where changes to rtorrent settings wouldn't take effect until a restart --- couchpotato/core/downloaders/rtorrent/main.py | 9 +++++++++ couchpotato/core/settings/__init__.py | 1 + 2 files changed, 10 insertions(+) diff --git a/couchpotato/core/downloaders/rtorrent/main.py b/couchpotato/core/downloaders/rtorrent/main.py index cfd1dce0..4fdecc89 100755 --- a/couchpotato/core/downloaders/rtorrent/main.py +++ b/couchpotato/core/downloaders/rtorrent/main.py @@ -24,6 +24,7 @@ class rTorrent(Downloader): super(rTorrent, self).__init__() addEvent('app.load', self.migrate) + addEvent('setting.save.rtorrent.*.after', self.settingsChanged) def migrate(self): @@ -37,6 +38,14 @@ class rTorrent(Downloader): self.deleteConf('url') + def settingsChanged(self): + # Reset active connection if settings have changed + if self.rt: + log.debug('Settings have changed, closing active connection') + + self.rt = None + return True + def connect(self): # Already connected? if self.rt is not None: diff --git a/couchpotato/core/settings/__init__.py b/couchpotato/core/settings/__init__.py index 3b575176..0e65c778 100644 --- a/couchpotato/core/settings/__init__.py +++ b/couchpotato/core/settings/__init__.py @@ -200,6 +200,7 @@ class Settings(object): # After save (for re-interval etc) fireEvent('setting.save.%s.%s.after' % (section, option), single = True) + fireEvent('setting.save.%s.*.after' % section, single = True) return { 'success': True,