diff --git a/bazarr/api.py b/bazarr/api.py index 5143ec859..ee78227ab 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -1,5 +1,7 @@ # coding=utf-8 +import sys +import os import ast from datetime import timedelta from dateutil import rrule @@ -1977,6 +1979,12 @@ class Subtitles(Resource): else: subtitles_apply_mods(language, subtitles_path, [action]) + # apply chmod if required + chmod = int(settings.general.chmod, 8) if not sys.platform.startswith( + 'win') and settings.general.getboolean('chmod_enabled') else None + if chmod: + os.chmod(subtitles_path, chmod) + return '', 204