From 15f6d8b3cd93934799e3201de6e7635de86bf7a5 Mon Sep 17 00:00:00 2001 From: evilhero Date: Wed, 27 Feb 2019 16:17:46 -0500 Subject: [PATCH] FIX:fix for enabling DDL as a provider within the GUI requiring a restart for the monitor to start, FIX: fix for enabling CDH as an option within the GUI requiring a restart for the monitor to start --- mylar/config.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mylar/config.py b/mylar/config.py index 3e084da5..09af5821 100644 --- a/mylar/config.py +++ b/mylar/config.py @@ -6,6 +6,7 @@ import os import glob import codecs import shutil +import threading import re import ConfigParser import mylar @@ -288,6 +289,7 @@ _CONFIG_DEFINITIONS = OrderedDict({ 'ENABLE_DDL': (bool, 'DDL', False), 'ALLOW_PACKS': (bool, 'DDL', False), 'DDL_LOCATION': (str, 'DDL', None), + 'DDL_AUTORESUME': (bool, 'DDL', True), 'AUTO_SNATCH': (bool, 'AutoSnatch', False), 'AUTO_SNATCH_SCRIPT': (str, 'AutoSnatch', None), @@ -900,6 +902,24 @@ class Config(object): else: logger.fdebug('Successfully created ComicTagger Settings location.') + #make sure queues are running here... + if all([mylar.NZBPOOL is None, self.POST_PROCESSING is True]) and ( all([self.NZB_DOWNLOADER == 0, self.SAB_CLIENT_POST_PROCESSING is True]) or all([self.NZB_DOWNLOADER == 1, self.NZB_CLIENT_POST_PROCESSING is True]) ): + if self.NZB_DOWNLOADER == 0: + logger.info('[SAB-MONITOR] Completed post-processing handling enabled for SABnzbd. Attempting to background load....') + elif self.NZB_DOWNLOADER == 1: + logger.info('[NZBGET-MONITOR] Completed post-processing handling enabled for NZBGet. Attempting to background load....') + mylar.NZBPOOL = threading.Thread(target=helpers.nzb_monitor, args=(mylar.NZB_QUEUE,), name="AUTO-COMPLETE-NZB") + mylar.NZBPOOL.start() + if self.NZB_DOWNLOADER == 0: + logger.info('[AUTO-COMPLETE-NZB] Succesfully started Completed post-processing handling for SABnzbd - will now monitor for completed nzbs within sabnzbd and post-process automatically...') + elif self.NZB_DOWNLOADER == 1: + logger.info('[AUTO-COMPLETE-NZB] Succesfully started Completed post-processing handling for NZBGet - will now monitor for completed nzbs within nzbget and post-process automatically...') + + if all([mylar.DDLPOOL is None, self.ENABLE_DDL is True]): + mylar.DDLPOOL = threading.Thread(target=helpers.ddl_downloader, args=(mylar.DDL_QUEUE,), name='DDL-QUEUE') + mylar.DDLPOOL.start() + logger.info('[DDL-QUEUE] Succesfully started DDL Download Queuer....') + if not self.DDL_LOCATION: self.DDL_LOCATION = self.CACHE_DIR if self.ENABLE_DDL is True: