diff --git a/CHANGES.md b/CHANGES.md index c1485178..f232ff8c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -30,6 +30,7 @@ * Change layout of Recent Search code * Change naming of SEARCHQUEUE threads for shorter log lines * Fix Recent Search running status on Manage Searches page +* Change to no longer require restart with the "Scan and post process" option on page config/Post Processing [develop changelog] * Fix traceback error when using the menu item Manage/Update Kodi diff --git a/sickbeard/autoPostProcesser.py b/sickbeard/autoPostProcesser.py index b043fb4e..5406b5ac 100644 --- a/sickbeard/autoPostProcesser.py +++ b/sickbeard/autoPostProcesser.py @@ -24,8 +24,15 @@ from sickbeard import encodingKludge as ek class PostProcesser(): - @staticmethod - def run(): + def __init__(self): + self.amActive = False + + def run(self): + if not sickbeard.PROCESS_AUTOMATICALLY: + return + + self.amActive = True + if not ek.ek(os.path.isdir, sickbeard.TV_DOWNLOAD_DIR): logger.log(u"Automatic post-processing attempted but dir %s doesn't exist" % sickbeard.TV_DOWNLOAD_DIR, logger.ERROR) @@ -36,4 +43,6 @@ class PostProcesser(): '(and probably not what you really want to process)' % sickbeard.TV_DOWNLOAD_DIR, logger.ERROR) return - processTV.processDir(sickbeard.TV_DOWNLOAD_DIR) \ No newline at end of file + processTV.processDir(sickbeard.TV_DOWNLOAD_DIR) + + self.amActive = False \ No newline at end of file diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 8d7f428e..5d7cd702 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3586,7 +3586,15 @@ class ConfigPostProcessing(Config): if not config.change_TV_DOWNLOAD_DIR(tv_download_dir): results += ['Unable to create directory ' + os.path.normpath(tv_download_dir) + ', dir not changed.'] - sickbeard.PROCESS_AUTOMATICALLY = config.checkbox_to_value(process_automatically) + new_val = config.checkbox_to_value(process_automatically) + if new_val != sickbeard.PROCESS_AUTOMATICALLY: + if not sickbeard.PROCESS_AUTOMATICALLY and not sickbeard.autoPostProcesserScheduler.ident: + try: + sickbeard.autoPostProcesserScheduler.start() + except: + pass + sickbeard.PROCESS_AUTOMATICALLY = new_val + config.change_AUTOPOSTPROCESSER_FREQUENCY(autopostprocesser_frequency) if sickbeard.PROCESS_AUTOMATICALLY: