From ebc5a66375c65aa94b09d9afcc32432a3babb29d Mon Sep 17 00:00:00 2001 From: mikke89 Date: Sun, 26 Jan 2014 18:17:23 +0100 Subject: [PATCH] Fixed 'connection test' for Transmission and Sabnzbd --- couchpotato/core/downloaders/sabnzbd/main.py | 2 +- couchpotato/core/downloaders/transmission/main.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/downloaders/sabnzbd/main.py b/couchpotato/core/downloaders/sabnzbd/main.py index fd23211e..6b96d95e 100644 --- a/couchpotato/core/downloaders/sabnzbd/main.py +++ b/couchpotato/core/downloaders/sabnzbd/main.py @@ -20,7 +20,7 @@ class Sabnzbd(Downloader): def test(self): try: sab_data = self.call({ - 'mode': 'version', + 'mode': 'qstatus', }) except: return False diff --git a/couchpotato/core/downloaders/transmission/main.py b/couchpotato/core/downloaders/transmission/main.py index 5e952306..eb73b62e 100644 --- a/couchpotato/core/downloaders/transmission/main.py +++ b/couchpotato/core/downloaders/transmission/main.py @@ -20,20 +20,20 @@ class Transmission(Downloader): trpc = None testable = True - def connect(self): + def connect(self, reconnect = True): # Load host from config and split out port. host = cleanHost(self.conf('host'), protocol = False).split(':') if not isInt(host[1]): log.error('Config properties are not filled in correctly, port is missing.') return False - if not (self.trpc and self.trpc.get_session()): + if not self.trpc or reconnect: self.trpc = TransmissionRPC(host[0], port = host[1], rpc_url = self.conf('rpc_url').strip('/ '), username = self.conf('username'), password = self.conf('password')) return self.trpc def test(self): - if self.connect() and self.trpc.get_session(): + if self.connect(True) and self.trpc.get_session(): return True return False