Fixed trakt library update issues.

This commit is contained in:
echel0n 2014-07-28 17:58:49 -07:00
parent b484192390
commit cdd190e1e7
4 changed files with 11 additions and 10 deletions

View file

@ -1171,6 +1171,13 @@ def halt():
logger.log(u"Aborting all threads") 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() dailySearchScheduler.stop.set()
logger.log(u"Waiting for the DAILYSEARCH thread to exit") logger.log(u"Waiting for the DAILYSEARCH thread to exit")
try: try:
@ -1249,13 +1256,6 @@ def halt():
except: except:
pass pass
events.stop.set()
logger.log(u"Waiting for the EVENTS thread to exit")
try:
events.join(10)
except:
pass
__INITIALIZED__ = False __INITIALIZED__ = False
started = False started = False

View file

@ -39,6 +39,7 @@ class Scheduler(threading.Thread):
self.silent = silent self.silent = silent
self.stop = threading.Event() self.stop = threading.Event()
self.force = False self.force = False
self.daemon = False
def timeLeft(self): def timeLeft(self):
return self.cycleTime - (datetime.datetime.now() - self.lastRun) return self.cycleTime - (datetime.datetime.now() - self.lastRun)

View file

@ -60,10 +60,10 @@ class TraktChecker():
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)
return 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): 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: if sickbeard.showList:
for myShow in sickbeard.showList: for myShow in sickbeard.showList:
self.addShowToTraktLibrary(myShow) self.addShowToTraktLibrary(myShow)

View file

@ -2769,7 +2769,7 @@ class NewHomeAddShows(MainHandler):
return return
map(final_results.append, 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 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'])))) recommendedlist if not helpers.findCertainShow(sickbeard.showList, indexerid=int(show['tvdb_id']))))