diff --git a/couchpotato/core/_base/_core/__init__.py b/couchpotato/core/_base/_core/__init__.py index ff2bd07d..d90fa59b 100644 --- a/couchpotato/core/_base/_core/__init__.py +++ b/couchpotato/core/_base/_core/__init__.py @@ -81,13 +81,13 @@ config = [{ }, { 'name': 'permission_folder', - 'default': 0755, + 'default': '0755', 'label': 'Folder CHMOD', - 'description': 'Permission (decimal) for creating/copying folders. 0755 => 593, 0777 => 511', + 'description': 'Can be either decimal (493) or octal (leading zero: 0755)', }, { 'name': 'permission_file', - 'default': 0755, + 'default': '0755', 'label': 'File CHMOD', 'description': 'Same as Folder CHMOD but for files', }, diff --git a/couchpotato/environment.py b/couchpotato/environment.py index 53cb5408..1ac62b6a 100644 --- a/couchpotato/environment.py +++ b/couchpotato/environment.py @@ -62,8 +62,12 @@ class Env(object): return s @staticmethod - def getPermission(type): - return int(Env.get('settings').get('permission_%s' % type, default = 0777)) + def getPermission(setting_type): + perm = Env.get('settings').get('permission_%s' % setting_type, default = '0777') + if perm[0] == '0': + return oct(int(perm, 8)) + else: + return oct(int(perm)) @staticmethod def fireEvent(*args, **kwargs):