Fixed 'connection test' for Transmission and Sabnzbd
This commit is contained in:
@@ -20,7 +20,7 @@ class Sabnzbd(Downloader):
|
||||
def test(self):
|
||||
try:
|
||||
sab_data = self.call({
|
||||
'mode': 'version',
|
||||
'mode': 'qstatus',
|
||||
})
|
||||
except:
|
||||
return False
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user