Skip to content

Commit

Permalink
chmod as option
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Higgins committed Feb 16, 2015
1 parent 24ee079 commit f404c17
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions autoProcess.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ download-artwork=True
download-subs=False
embed-subs=True
sub-providers=addic7ed,podnapisi,thesubdb,opensubtitles
permissions=0777

[CouchPotato]
host = localhost
Expand Down
9 changes: 6 additions & 3 deletions mkvtomp4.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def __init__( self, settings=None,
copyto=None,
moveto=None,
embedsubs=True,
providers=['addic7ed', 'podnapisi', 'thesubdb', 'opensubtitles']):
providers=['addic7ed', 'podnapisi', 'thesubdb', 'opensubtitles'],
permissions=0777):
# Settings
self.FFMPEG_PATH=FFMPEG_PATH
self.FFPROBE_PATH=FFPROBE_PATH
Expand All @@ -48,6 +49,7 @@ def __init__( self, settings=None,
self.copyto=copyto
self.moveto=moveto
self.relocate_moov=relocate_moov
self.permissions=permissions
# Video settings
self.video_codec=video_codec
self.video_bitrate=video_bitrate
Expand Down Expand Up @@ -83,6 +85,7 @@ def importSettings(self, settings):
self.copyto=settings.copyto
self.moveto=settings.moveto
self.relocate_moov = settings.relocate_moov
self.permissions = settings.permissions
#Video settings
self.video_codec=settings.vcodec
self.video_bitrate=settings.vbitrate
Expand Down Expand Up @@ -416,7 +419,7 @@ def convert(self, inputfile, options, reportProgress=False):
pass

try:
os.chmod(outputfile, 0777) # Set permissions of newly created file
os.chmod(outputfile, self.permissions) # Set permissions of newly created file
except:
pass
return outputfile, inputfile
Expand Down Expand Up @@ -444,7 +447,7 @@ def QTFS(self, inputfile):
try:
processor.process(inputfile, outputfile)
try:
os.chmod(outputfile, 0777)
os.chmod(outputfile, self.permissions)
except:
pass
# Cleanup
Expand Down
9 changes: 8 additions & 1 deletion readSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def __init__(self, directory, filename):
'download-artwork': 'True',
'download-subs': 'False',
'embed-subs': 'True',
'sub-providers': 'addic7ed, podnapisi, thesubdb, opensubtitles' }
'sub-providers': 'addic7ed, podnapisi, thesubdb, opensubtitles',
'permissions': '777' }
# Default settings for CouchPotato
cp_defaults = {'host': 'localhost',
'port': '5050',
Expand Down Expand Up @@ -190,6 +191,12 @@ def __init__(self, directory, filename):

self.embedsubs = config.getboolean(section, 'embed-subs')

self.permissions = config.get(section, 'permissions')
try:
self.permissions = int(self.permissions, 8)
except:
self.permissions = 0777

#Setup variable for maximum audio channels
self.maxchannels = config.get(section, 'max-audio-channels')
if self.maxchannels == "":
Expand Down

0 comments on commit f404c17

Please sign in to comment.