From 514d477a326bf317fbaa4ee74f37d23f238035c9 Mon Sep 17 00:00:00 2001 From: Nils Vogels Date: Thu, 8 May 2014 17:23:26 +0200 Subject: [PATCH] Better detection when to show the button --- sickbeard/webserve.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 0bca1197..5d375bc8 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -1924,8 +1924,15 @@ def haveXBMC(): def havePLEX(): return sickbeard.USE_PLEX and sickbeard.PLEX_UPDATE_LIBRARY + def haveTORRENT(): - return sickbeard.USE_TORRENTS + if sickbeard.USE_TORRENTS and sickbeard.TORRENT_METHOD != 'blackhole' \ + and (sickbeard.ENABLE_HTTPS and sickbeard.TORRENT_HOST[:5] == 'https' + or not sickbeard.ENABLE_HTTPS and sickbeard.TORRENT_HOST[:5] == 'http:'): + return True + else: + return False + def HomeMenu(): return [ @@ -1933,7 +1940,7 @@ def HomeMenu(): {'title': 'Manual Post-Processing', 'path': 'home/postprocess/'}, {'title': 'Update XBMC', 'path': 'home/updateXBMC/', 'requires': haveXBMC}, {'title': 'Update Plex', 'path': 'home/updatePLEX/', 'requires': havePLEX}, - {'title': 'Manage Torrents', 'path': '/manage/manageTorrents', 'requires': haveTORRENT}, + {'title': 'Manage Torrents', 'path': 'manage/manageTorrents', 'requires': haveTORRENT}, {'title': 'Restart', 'path': 'home/restart/?pid=' + str(sickbeard.PID), 'confirm': True}, {'title': 'Shutdown', 'path': 'home/shutdown/?pid=' + str(sickbeard.PID), 'confirm': True}, ]