Fix for trakt connection issues.

This commit is contained in:
echel0n 2014-07-27 07:39:33 -07:00
parent 60205979a8
commit 4094e2ed3c
2 changed files with 18 additions and 11 deletions

View file

@ -55,8 +55,7 @@ class TraktChecker():
logger.log(traceback.format_exc(), logger.DEBUG) logger.log(traceback.format_exc(), logger.DEBUG)
def findShow(self, indexer, indexerid): def findShow(self, indexer, indexerid):
library = TraktCall("user/library/shows/all.json/%API%/" + sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_API, library = TraktCall("user/library/shows/all.json/%API%/", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
if not library: if not library:
logger.log(u"Could not connect to trakt service, aborting library check", logger.ERROR) logger.log(u"Could not connect to trakt service, aborting library check", logger.ERROR)
@ -120,8 +119,8 @@ class TraktChecker():
def updateShows(self): def updateShows(self):
logger.log(u"Starting trakt show watchlist check", logger.DEBUG) logger.log(u"Starting trakt show watchlist check", logger.DEBUG)
watchlist = TraktCall("user/watchlist/shows.json/%API%/" + sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_API, watchlist = TraktCall("user/watchlist/shows.json/%API%/", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
if not watchlist: if not watchlist:
logger.log(u"Could not connect to trakt service, aborting watchlist update", logger.ERROR) logger.log(u"Could not connect to trakt service, aborting watchlist update", logger.ERROR)
return return
@ -152,8 +151,8 @@ class TraktChecker():
Sets episodes to wanted that are in trakt watchlist Sets episodes to wanted that are in trakt watchlist
""" """
logger.log(u"Starting trakt episode watchlist check", logger.DEBUG) logger.log(u"Starting trakt episode watchlist check", logger.DEBUG)
watchlist = TraktCall("user/watchlist/episodes.json/%API%/" + sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_API, watchlist = TraktCall("user/watchlist/episodes.json/%API%/", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
if not watchlist: if not watchlist:
logger.log(u"Could not connect to trakt service, aborting watchlist update", logger.ERROR) logger.log(u"Could not connect to trakt service, aborting watchlist update", logger.ERROR)
return return

View file

@ -83,6 +83,7 @@ from lib import adba
from Cheetah.Template import Template from Cheetah.Template import Template
from tornado.web import RequestHandler, HTTPError, asynchronous from tornado.web import RequestHandler, HTTPError, asynchronous
def authenticated(handler_class): def authenticated(handler_class):
def wrap_execute(handler_execute): def wrap_execute(handler_execute):
def basicauth(handler, transforms, *args, **kwargs): def basicauth(handler, transforms, *args, **kwargs):
@ -145,6 +146,7 @@ def redirect(url, permanent=False, status=None):
assert url[0] == '/' assert url[0] == '/'
raise HTTPRedirect(sickbeard.WEB_ROOT + url, permanent, status) raise HTTPRedirect(sickbeard.WEB_ROOT + url, permanent, status)
@authenticated @authenticated
class MainHandler(RequestHandler): class MainHandler(RequestHandler):
def http_error_401_handler(self): def http_error_401_handler(self):
@ -1506,6 +1508,7 @@ class ConfigGeneral(MainHandler):
redirect("/config/general/") redirect("/config/general/")
class ConfigBackupRestore(MainHandler): class ConfigBackupRestore(MainHandler):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
t = PageTemplate(headers=self.request.headers, file="config_backuprestore.tmpl") t = PageTemplate(headers=self.request.headers, file="config_backuprestore.tmpl")
@ -1633,6 +1636,7 @@ class ConfigSearch(MainHandler):
redirect("/config/search/") redirect("/config/search/")
class ConfigPostProcessing(MainHandler): class ConfigPostProcessing(MainHandler):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
@ -2178,6 +2182,7 @@ class ConfigProviders(MainHandler):
redirect("/config/providers/") redirect("/config/providers/")
class ConfigNotifications(MainHandler): class ConfigNotifications(MainHandler):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
t = PageTemplate(headers=self.request.headers, file="config_notifications.tmpl") t = PageTemplate(headers=self.request.headers, file="config_notifications.tmpl")
@ -2211,7 +2216,8 @@ class ConfigNotifications(MainHandler):
use_nmjv2=None, nmjv2_host=None, nmjv2_dbloc=None, nmjv2_database=None, use_nmjv2=None, nmjv2_host=None, nmjv2_dbloc=None, nmjv2_database=None,
use_trakt=None, trakt_username=None, trakt_password=None, trakt_api=None, use_trakt=None, trakt_username=None, trakt_password=None, trakt_api=None,
trakt_remove_watchlist=None, trakt_use_watchlist=None, trakt_method_add=None, trakt_remove_watchlist=None, trakt_use_watchlist=None, trakt_method_add=None,
trakt_start_paused=None, trakt_use_recommended=None, trakt_sync=None, trakt_default_indexer=None, trakt_start_paused=None, trakt_use_recommended=None, trakt_sync=None,
trakt_default_indexer=None,
use_synologynotifier=None, synologynotifier_notify_onsnatch=None, use_synologynotifier=None, synologynotifier_notify_onsnatch=None,
synologynotifier_notify_ondownload=None, synologynotifier_notify_onsubtitledownload=None, synologynotifier_notify_ondownload=None, synologynotifier_notify_onsubtitledownload=None,
use_pytivo=None, pytivo_notify_onsnatch=None, pytivo_notify_ondownload=None, use_pytivo=None, pytivo_notify_onsnatch=None, pytivo_notify_ondownload=None,
@ -2384,6 +2390,7 @@ class ConfigNotifications(MainHandler):
redirect("/config/notifications/") redirect("/config/notifications/")
class ConfigSubtitles(MainHandler): class ConfigSubtitles(MainHandler):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
t = PageTemplate(headers=self.request.headers, file="config_subtitles.tmpl") t = PageTemplate(headers=self.request.headers, file="config_subtitles.tmpl")
@ -2441,6 +2448,7 @@ class ConfigSubtitles(MainHandler):
redirect("/config/subtitles/") redirect("/config/subtitles/")
class ConfigAnime(MainHandler): class ConfigAnime(MainHandler):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
@ -2472,6 +2480,7 @@ class ConfigAnime(MainHandler):
redirect("/config/anime/") redirect("/config/anime/")
class Config(MainHandler): class Config(MainHandler):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
t = PageTemplate(headers=self.request.headers, file="config.tmpl") t = PageTemplate(headers=self.request.headers, file="config.tmpl")
@ -2535,7 +2544,8 @@ class HomePostProcess(MainHandler):
redirect("/home/") redirect("/home/")
def processEpisode(self, dir=None, nzbName=None, jobName=None, quiet=None, process_method=None, force=None, is_priority=None, failed="0", type="auto", *args, **kwargs): def processEpisode(self, dir=None, nzbName=None, jobName=None, quiet=None, process_method=None, force=None,
is_priority=None, failed="0", type="auto", *args, **kwargs):
if failed == "0": if failed == "0":
failed = False failed = False
@ -2758,9 +2768,7 @@ class NewHomeAddShows(MainHandler):
final_results = [] final_results = []
logger.log(u"Getting recommended shows from Trakt.tv", logger.DEBUG) logger.log(u"Getting recommended shows from Trakt.tv", logger.DEBUG)
recommendedlist = TraktCall("recommendations/shows.json/%API%/" + sickbeard.TRAKT_USERNAME, recommendedlist = TraktCall("recommendations/shows.json/%API%/", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
sickbeard.TRAKT_API,
sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
if recommendedlist is None: if recommendedlist is None:
logger.log(u"Could not connect to trakt service, aborting recommended list update", logger.ERROR) logger.log(u"Could not connect to trakt service, aborting recommended list update", logger.ERROR)
return return