rTorrent connection test: Error message on version check fail

This commit is contained in:
mikke89
2014-02-21 20:28:49 +01:00
parent 499b8193ab
commit 893dde9958
2 changed files with 15 additions and 5 deletions
+14 -5
View File
@@ -19,6 +19,7 @@ class rTorrent(Downloader):
protocol = ['torrent', 'torrent_magnet']
rt = None
testable = True
error_msg = ''
# Migration url to host options
def __init__(self):
@@ -54,15 +55,23 @@ class rTorrent(Downloader):
else:
self.rt = RTorrent(url)
if not self.rt.test_connection():
self.rt = None
self.error_msg = ''
try:
self.rt._verify_conn()
except AssertionError as e:
self.error_msg = e.message
self.rt = None
return self.rt
def test(self):
if not self.connect(True):
return False
return True
if self.connect(True):
return True
if self.error_msg:
return False, 'Connection failed: ' + self.error_msg
return False
def _update_provider_group(self, name, data):
if data.get('seed_time'):
@@ -26,6 +26,7 @@ class Sabnzbd(Downloader):
if int(v[0]) == 0 and int(v[1]) < 7:
return False, 'Your Sabnzbd client is too old, please update to newest version.'
# the version check will work even with wrong api key, so we need the next check as well
sab_data = self.call({
'mode': 'qstatus',
})