Add the ability to set octal permissions on the processed files prior to handing it off to Sickrage/Couchpotato

If set, the `chmodDirectory` option instructs the nzbToMedia
post-processing script to set the recursive directory permissions to the
octal value specified.
This commit is contained in:
Marvin Pinto 2016-10-03 10:23:18 -04:00
commit cb0de3ca98
3 changed files with 17 additions and 0 deletions

View file

@ -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)]