diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index dd13d18d..28e27934 100755 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -1171,6 +1171,13 @@ def halt(): logger.log(u"Aborting all threads") + events.stop.set() + logger.log(u"Waiting for the EVENTS thread to exit") + try: + events.join(10) + except: + pass + dailySearchScheduler.stop.set() logger.log(u"Waiting for the DAILYSEARCH thread to exit") try: @@ -1249,13 +1256,6 @@ def halt(): except: pass - events.stop.set() - logger.log(u"Waiting for the EVENTS thread to exit") - try: - events.join(10) - except: - pass - __INITIALIZED__ = False started = False diff --git a/sickbeard/scheduler.py b/sickbeard/scheduler.py index 6d69dc79..6d5b4983 100644 --- a/sickbeard/scheduler.py +++ b/sickbeard/scheduler.py @@ -39,6 +39,7 @@ class Scheduler(threading.Thread): self.silent = silent self.stop = threading.Event() self.force = False + self.daemon = False def timeLeft(self): return self.cycleTime - (datetime.datetime.now() - self.lastRun) diff --git a/sickbeard/traktChecker.py b/sickbeard/traktChecker.py index 7a2fabc2..af6544b6 100644 --- a/sickbeard/traktChecker.py +++ b/sickbeard/traktChecker.py @@ -60,10 +60,10 @@ class TraktChecker(): logger.log(u"Could not connect to trakt service, aborting library check", logger.ERROR) return - return filter(lambda x: int(indexerid) in [int(x.tvdb_id), int(x.tvrage_id)], library) + return filter(lambda x: int(indexerid) in [int(x['tvdb_id']) or 0, int(x['tvrage_id'])] or 0, library) def syncLibrary(self): - logger.log(u"Syncing library to trakt.tv show library", logger.DEBUG) + logger.log(u"Syncing library to Trakt.tv show library", logger.DEBUG) if sickbeard.showList: for myShow in sickbeard.showList: self.addShowToTraktLibrary(myShow) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 5b1cbe8c..6b96dc8b 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -2769,7 +2769,7 @@ class NewHomeAddShows(MainHandler): return map(final_results.append, - ([int(show['tvdb_id']), show['url'], show['title'], show['overview'], + ([int(show['tvdb_id'] or 0) if sickbeard.TRAKT_DEFAULT_INDEXER == 1 else int(show['tvdb_id'] or 0), show['url'], show['title'], show['overview'], datetime.date.fromtimestamp(int(show['first_aired']) / 1000.0).strftime('%Y%m%d')] for show in recommendedlist if not helpers.findCertainShow(sickbeard.showList, indexerid=int(show['tvdb_id']))))