mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-01 00:43:37 +00:00
Fix for trakt connection issues.
This commit is contained in:
parent
60205979a8
commit
4094e2ed3c
2 changed files with 18 additions and 11 deletions
|
@ -55,8 +55,7 @@ class TraktChecker():
|
|||
logger.log(traceback.format_exc(), logger.DEBUG)
|
||||
|
||||
def findShow(self, indexer, indexerid):
|
||||
library = TraktCall("user/library/shows/all.json/%API%/" + sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_API,
|
||||
sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
|
||||
library = TraktCall("user/library/shows/all.json/%API%/", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
|
||||
|
||||
if not library:
|
||||
logger.log(u"Could not connect to trakt service, aborting library check", logger.ERROR)
|
||||
|
@ -120,8 +119,8 @@ class TraktChecker():
|
|||
|
||||
def updateShows(self):
|
||||
logger.log(u"Starting trakt show watchlist check", logger.DEBUG)
|
||||
watchlist = TraktCall("user/watchlist/shows.json/%API%/" + sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_API,
|
||||
sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
|
||||
watchlist = TraktCall("user/watchlist/shows.json/%API%/", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
|
||||
|
||||
if not watchlist:
|
||||
logger.log(u"Could not connect to trakt service, aborting watchlist update", logger.ERROR)
|
||||
return
|
||||
|
@ -152,8 +151,8 @@ class TraktChecker():
|
|||
Sets episodes to wanted that are in trakt watchlist
|
||||
"""
|
||||
logger.log(u"Starting trakt episode watchlist check", logger.DEBUG)
|
||||
watchlist = TraktCall("user/watchlist/episodes.json/%API%/" + sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_API,
|
||||
sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
|
||||
watchlist = TraktCall("user/watchlist/episodes.json/%API%/", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
|
||||
|
||||
if not watchlist:
|
||||
logger.log(u"Could not connect to trakt service, aborting watchlist update", logger.ERROR)
|
||||
return
|
||||
|
|
|
@ -83,6 +83,7 @@ from lib import adba
|
|||
from Cheetah.Template import Template
|
||||
from tornado.web import RequestHandler, HTTPError, asynchronous
|
||||
|
||||
|
||||
def authenticated(handler_class):
|
||||
def wrap_execute(handler_execute):
|
||||
def basicauth(handler, transforms, *args, **kwargs):
|
||||
|
@ -145,6 +146,7 @@ def redirect(url, permanent=False, status=None):
|
|||
assert url[0] == '/'
|
||||
raise HTTPRedirect(sickbeard.WEB_ROOT + url, permanent, status)
|
||||
|
||||
|
||||
@authenticated
|
||||
class MainHandler(RequestHandler):
|
||||
def http_error_401_handler(self):
|
||||
|
@ -1506,6 +1508,7 @@ class ConfigGeneral(MainHandler):
|
|||
|
||||
redirect("/config/general/")
|
||||
|
||||
|
||||
class ConfigBackupRestore(MainHandler):
|
||||
def index(self, *args, **kwargs):
|
||||
t = PageTemplate(headers=self.request.headers, file="config_backuprestore.tmpl")
|
||||
|
@ -1633,6 +1636,7 @@ class ConfigSearch(MainHandler):
|
|||
|
||||
redirect("/config/search/")
|
||||
|
||||
|
||||
class ConfigPostProcessing(MainHandler):
|
||||
def index(self, *args, **kwargs):
|
||||
|
||||
|
@ -2178,6 +2182,7 @@ class ConfigProviders(MainHandler):
|
|||
|
||||
redirect("/config/providers/")
|
||||
|
||||
|
||||
class ConfigNotifications(MainHandler):
|
||||
def index(self, *args, **kwargs):
|
||||
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_trakt=None, trakt_username=None, trakt_password=None, trakt_api=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,
|
||||
synologynotifier_notify_ondownload=None, synologynotifier_notify_onsubtitledownload=None,
|
||||
use_pytivo=None, pytivo_notify_onsnatch=None, pytivo_notify_ondownload=None,
|
||||
|
@ -2384,6 +2390,7 @@ class ConfigNotifications(MainHandler):
|
|||
|
||||
redirect("/config/notifications/")
|
||||
|
||||
|
||||
class ConfigSubtitles(MainHandler):
|
||||
def index(self, *args, **kwargs):
|
||||
t = PageTemplate(headers=self.request.headers, file="config_subtitles.tmpl")
|
||||
|
@ -2441,6 +2448,7 @@ class ConfigSubtitles(MainHandler):
|
|||
|
||||
redirect("/config/subtitles/")
|
||||
|
||||
|
||||
class ConfigAnime(MainHandler):
|
||||
def index(self, *args, **kwargs):
|
||||
|
||||
|
@ -2472,6 +2480,7 @@ class ConfigAnime(MainHandler):
|
|||
|
||||
redirect("/config/anime/")
|
||||
|
||||
|
||||
class Config(MainHandler):
|
||||
def index(self, *args, **kwargs):
|
||||
t = PageTemplate(headers=self.request.headers, file="config.tmpl")
|
||||
|
@ -2535,7 +2544,8 @@ class HomePostProcess(MainHandler):
|
|||
|
||||
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":
|
||||
failed = False
|
||||
|
@ -2758,9 +2768,7 @@ class NewHomeAddShows(MainHandler):
|
|||
final_results = []
|
||||
|
||||
logger.log(u"Getting recommended shows from Trakt.tv", logger.DEBUG)
|
||||
recommendedlist = TraktCall("recommendations/shows.json/%API%/" + sickbeard.TRAKT_USERNAME,
|
||||
sickbeard.TRAKT_API,
|
||||
sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
|
||||
recommendedlist = TraktCall("recommendations/shows.json/%API%/", sickbeard.TRAKT_API, sickbeard.TRAKT_USERNAME, sickbeard.TRAKT_PASSWORD)
|
||||
if recommendedlist is None:
|
||||
logger.log(u"Could not connect to trakt service, aborting recommended list update", logger.ERROR)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue