From c145d3abde4111d795b62c4f41c1415a4cfb8f67 Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Sat, 6 Aug 2016 08:16:22 +0930 Subject: [PATCH] fix issues with import of cfg. --- nzbToMedia.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nzbToMedia.py b/nzbToMedia.py index bce75147..10c68a46 100755 --- a/nzbToMedia.py +++ b/nzbToMedia.py @@ -581,16 +581,18 @@ def process(inputDirectory, inputName=None, status=0, clientAgent='manual', down inputCategory)) return [-1, ""] - extract = int(section[usercat].get('extract', 0)) + cfg = dict(core.CFG[sectionName][usercat]) + + extract = int(cfg.get("extract", 0)) try: - if int(section[usercat]['remote_path']) and not core.REMOTEPATHS: + if int(cfg.get("remote_path")) and not core.REMOTEPATHS: logger.error('Remote Path is enabled for {0}:{1} but no Network mount points are defined. Please check your autoProcessMedia.cfg, exiting!'.format( sectionName, inputCategory)) return [-1, ""] except: logger.error('Remote Path {0} is not valid for {1}:{2} Please set this to either 0 to disable or 1 to enable!'.format( - section[usercat]['remote_path'], sectionName, inputCategory)) + core.get("remote_path"), sectionName, inputCategory)) inputName, inputDirectory = convert_to_ascii(inputName, inputDirectory)