diff --git a/autoProcessMedia.cfg.spec b/autoProcessMedia.cfg.spec index f1f47058..02992a4c 100644 --- a/autoProcessMedia.cfg.spec +++ b/autoProcessMedia.cfg.spec @@ -64,6 +64,8 @@ remote_path = 0 ##### Set to path where download client places completed downloads locally for this category watch_dir = + ##### Set the recursive directory permissions to the following (0 to disable) + chmodDirectory = 0 [SickBeard] #### autoProcessing for TV Series @@ -99,6 +101,8 @@ remote_path = 0 ##### Set to path where download client places completed downloads locally for this category watch_dir = + ##### Set the recursive directory permissions to the following (0 to disable) + chmodDirectory = 0 [NzbDrone] #### autoProcessing for TV Series diff --git a/core/autoProcess/autoProcessMovie.py b/core/autoProcess/autoProcessMovie.py index 7b89e40f..c0a2cd19 100644 --- a/core/autoProcess/autoProcessMovie.py +++ b/core/autoProcess/autoProcessMovie.py @@ -195,6 +195,12 @@ class autoProcessMovie(object): if result == 0: logger.debug("Transcoding succeeded for files in {0}".format(dirName), section) dirName = newDirName + + chmod_directory = int(cfg.get("chmodDirectory", 0), 8) + logger.debug("Config setting 'chmodDirectory' currently set to {0}".format(oct(chmod_directory)), section) + if chmod_directory: + logger.info("Attempting to set the octal permission of '{0}' on directory '{1}'".format(oct(chmod_directory), dirName), section) + core.rchmod(dirName, chmod_directory) else: logger.error("Transcoding failed for files in {0}".format(dirName), section) return [1, "{0}: Failed to post-process - Transcoding failed".format(section)] diff --git a/core/autoProcess/autoProcessTV.py b/core/autoProcess/autoProcessTV.py index e72b3ab0..04cd2039 100644 --- a/core/autoProcess/autoProcessTV.py +++ b/core/autoProcess/autoProcessTV.py @@ -163,12 +163,19 @@ class autoProcessTV(object): if result == 0: logger.debug("SUCCESS: Transcoding succeeded for files in {0}".format(dirName), section) dirName = newDirName + + chmod_directory = int(cfg.get("chmodDirectory", 0), 8) + logger.debug("Config setting 'chmodDirectory' currently set to {0}".format(oct(chmod_directory)), section) + if chmod_directory: + logger.info("Attempting to set the octal permission of '{0}' on directory '{1}'".format(oct(chmod_directory), dirName), section) + core.rchmod(dirName, chmod_directory) else: logger.error("FAILED: Transcoding failed for files in {0}".format(dirName), section) return [1, "{0}: Failed to post-process - Transcoding failed".format(section)] # configure SB params to pass fork_params['quiet'] = 1 + fork_params['proc_type'] = 'manual' if inputName is not None: fork_params['nzbName'] = inputName