mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 02:52:20 -05:00
Fix for threading schedualers and subtitles.
This commit is contained in:
parent
24cd235988
commit
0cdd1cf813
@ -14,7 +14,6 @@ class Events(threading.Thread):
|
|||||||
super(Events, self).__init__()
|
super(Events, self).__init__()
|
||||||
self.queue = Queue()
|
self.queue = Queue()
|
||||||
self.daemon = True
|
self.daemon = True
|
||||||
self.alive = True
|
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
self.name = "EVENT-QUEUE"
|
self.name = "EVENT-QUEUE"
|
||||||
self.stop = threading.Event()
|
self.stop = threading.Event()
|
||||||
|
@ -39,7 +39,6 @@ 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.alive = True
|
|
||||||
|
|
||||||
def timeLeft(self):
|
def timeLeft(self):
|
||||||
return self.cycleTime - (datetime.datetime.now() - self.lastRun)
|
return self.cycleTime - (datetime.datetime.now() - self.lastRun)
|
||||||
|
@ -2398,22 +2398,21 @@ class ConfigSubtitles(MainHandler):
|
|||||||
if subtitles_finder_frequency == '' or subtitles_finder_frequency is None:
|
if subtitles_finder_frequency == '' or subtitles_finder_frequency is None:
|
||||||
subtitles_finder_frequency = 1
|
subtitles_finder_frequency = 1
|
||||||
|
|
||||||
if use_subtitles == "on":
|
if use_subtitles == "on" and not sickbeard.subtitlesFinderScheduler.isAlive():
|
||||||
if not sickbeard.subtitlesFinderScheduler.isAlive():
|
sickbeard.subtitlesFinderScheduler.silent = False
|
||||||
sickbeard.subtitlesFinderScheduler.silent = False
|
sickbeard.subtitlesFinderScheduler.start()
|
||||||
sickbeard.subtitlesFinderScheduler.start()
|
|
||||||
else:
|
else:
|
||||||
sickbeard.subtitlesFinderScheduler.stop.set()
|
sickbeard.subtitlesFinderScheduler.stop.set()
|
||||||
sickbeard.subtitlesFinderScheduler.silent = True
|
sickbeard.subtitlesFinderScheduler.silent = True
|
||||||
logger.log(u"Waiting for the SUBTITLESFINDER thread to exit")
|
logger.log(u"Waiting for the SUBTITLESFINDER thread to exit")
|
||||||
try:
|
try:
|
||||||
sickbeard.subtitlesFinderScheduler.join()
|
sickbeard.subtitlesFinderScheduler.join(5)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
sickbeard.USE_SUBTITLES = config.checkbox_to_value(use_subtitles)
|
sickbeard.USE_SUBTITLES = config.checkbox_to_value(use_subtitles)
|
||||||
sickbeard.SUBTITLES_LANGUAGES = [lang.alpha2 for lang in subtitles.isValidLanguage(
|
sickbeard.SUBTITLES_LANGUAGES = [lang.alpha2 for lang in subtitles.isValidLanguage(
|
||||||
subtitles_languages.replace(' ', '').split(','))] if subtitles_languages != '' else ''
|
subtitles_languages.replace(' ', '').split(','))] if subtitles_languages != '' else ''
|
||||||
sickbeard.SUBTITLES_DIR = subtitles_dir
|
sickbeard.SUBTITLES_DIR = subtitles_dir
|
||||||
sickbeard.SUBTITLES_HISTORY = config.checkbox_to_value(subtitles_history)
|
sickbeard.SUBTITLES_HISTORY = config.checkbox_to_value(subtitles_history)
|
||||||
sickbeard.SUBTITLES_FINDER_FREQUENCY = config.to_int(subtitles_finder_frequency, default=1)
|
sickbeard.SUBTITLES_FINDER_FREQUENCY = config.to_int(subtitles_finder_frequency, default=1)
|
||||||
|
Loading…
Reference in New Issue
Block a user