rTorrent connection test: Error message on version check fail
This commit is contained in:
1 parent
499b8193ab
commit
893dde9958
2 files changed
+15
-5
No files matched your search
@@ -19,6 +19,7 @@ class rTorrent(Downloader):
|
|||||||
protocol = ['torrent', 'torrent_magnet']
|
protocol = ['torrent', 'torrent_magnet']
|
||||||
rt = None
|
rt = None
|
||||||
testable = True
|
testable = True
|
||||||
|
error_msg = ''
|
||||||
|
|
||||||
# Migration url to host options
|
# Migration url to host options
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -54,15 +55,23 @@ class rTorrent(Downloader):
|
|||||||
else:
|
else:
|
||||||
self.rt = RTorrent(url)
|
self.rt = RTorrent(url)
|
||||||
|
|
||||||
if not self.rt.test_connection():
|
self.error_msg = ''
|
||||||
self.rt = None
|
try:
|
||||||
|
self.rt._verify_conn()
|
||||||
|
except AssertionError as e:
|
||||||
|
self.error_msg = e.message
|
||||||
|
self.rt = None
|
||||||
|
|
||||||
return self.rt
|
return self.rt
|
||||||
|
|
||||||
def test(self):
|
def test(self):
|
||||||
if not self.connect(True):
|
if self.connect(True):
|
||||||
return False
|
return True
|
||||||
return True
|
|
||||||
|
if self.error_msg:
|
||||||
|
return False, 'Connection failed: ' + self.error_msg
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def _update_provider_group(self, name, data):
|
def _update_provider_group(self, name, data):
|
||||||
if data.get('seed_time'):
|
if data.get('seed_time'):
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class Sabnzbd(Downloader):
|
|||||||
if int(v[0]) == 0 and int(v[1]) < 7:
|
if int(v[0]) == 0 and int(v[1]) < 7:
|
||||||
return False, 'Your Sabnzbd client is too old, please update to newest version.'
|
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({
|
sab_data = self.call({
|
||||||
'mode': 'qstatus',
|
'mode': 'qstatus',
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user