Merge branch 'nightly' of https://github.com/clinton-hall/nzbToMedia into nightly

This commit is contained in:
clinton-hall 2016-10-07 22:48:30 +10:30
commit bfaf2ddb17
4 changed files with 31 additions and 14 deletions

View file

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

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

View file

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

View file

@ -271,20 +271,20 @@ def buildCommands(file, newDir, movieName, bitbucket):
if audio2: # right language and codec...
map_cmd.extend(['-map', '0:{index}'.format(index=audio2[0]["index"])])
a_mapped.extend([audio2[0]["index"]])
bitrate = int(audio2[0].get("bit_rate", 0)) / 1000
channels = int(audio2[0].get("channels", 0))
bitrate = int(float(audio2[0].get("bit_rate", 0))) / 1000
channels = int(float(audio2[0].get("channels", 0)))
audio_cmd.extend(['-c:a:{0}'.format(used_audio), 'copy'])
elif audio1: # right language wrong codec.
map_cmd.extend(['-map', '0:{index}'.format(index=audio1[0]["index"])])
a_mapped.extend([audio1[0]["index"]])
bitrate = int(audio1[0].get("bit_rate", 0)) / 1000
channels = int(audio1[0].get("channels", 0))
bitrate = int(float(audio1[0].get("bit_rate", 0))) / 1000
channels = int(float(audio1[0].get("channels", 0)))
audio_cmd.extend(['-c:a:{0}'.format(used_audio), core.ACODEC if core.ACODEC else 'copy'])
elif audio3: # just pick the default audio track
map_cmd.extend(['-map', '0:{index}'.format(index=audio3[0]["index"])])
a_mapped.extend([audio3[0]["index"]])
bitrate = int(audio3[0].get("bit_rate", 0)) / 1000
channels = int(audio3[0].get("channels", 0))
bitrate = int(float(audio3[0].get("bit_rate", 0))) / 1000
channels = int(float(audio3[0].get("channels", 0)))
audio_cmd.extend(['-c:a:{0}'.format(used_audio), core.ACODEC if core.ACODEC else 'copy'])
if core.ACHANNELS and channels and channels > core.ACHANNELS:
@ -311,14 +311,14 @@ def buildCommands(file, newDir, movieName, bitbucket):
if audio4: # right language and codec.
map_cmd.extend(['-map', '0:{index}'.format(index=audio4[0]["index"])])
a_mapped.extend([audio4[0]["index"]])
bitrate = int(audio4[0].get("bit_rate", 0)) / 1000
channels = int(audio4[0].get("channels", 0))
bitrate = int(float(audio4[0].get("bit_rate", 0))) / 1000
channels = int(float(audio4[0].get("channels", 0)))
audio_cmd2.extend(['-c:a:{0}'.format(used_audio), 'copy'])
elif audio1: # right language wrong codec.
map_cmd.extend(['-map', '0:{index}'.format(index=audio1[0]["index"])])
a_mapped.extend([audio1[0]["index"]])
bitrate = int(audio1[0].get("bit_rate", 0)) / 1000
channels = int(audio1[0].get("channels", 0))
bitrate = int(float(audio1[0].get("bit_rate", 0))) / 1000
channels = int(float(audio1[0].get("channels", 0)))
if core.ACODEC2:
audio_cmd2.extend(['-c:a:{0}'.format(used_audio), core.ACODEC2])
else:
@ -326,8 +326,8 @@ def buildCommands(file, newDir, movieName, bitbucket):
elif audio3: # just pick the default audio track
map_cmd.extend(['-map', '0:{index}'.format(index=audio3[0]["index"])])
a_mapped.extend([audio3[0]["index"]])
bitrate = int(audio3[0].get("bit_rate", 0)) / 1000
channels = int(audio3[0].get("channels", 0))
bitrate = int(float(audio3[0].get("bit_rate", 0))) / 1000
channels = int(float(audio3[0].get("channels", 0)))
if core.ACODEC2:
audio_cmd2.extend(['-c:a:{0}'.format(used_audio), core.ACODEC2])
else:
@ -356,8 +356,8 @@ def buildCommands(file, newDir, movieName, bitbucket):
used_audio += 1
map_cmd.extend(['-map', '0:{index}'.format(index=audio["index"])])
audio_cmd3 = []
bitrate = int(audio.get("bit_rate", 0)) / 1000
channels = int(audio.get("channels", 0))
bitrate = int(float(audio.get("bit_rate", 0))) / 1000
channels = int(float(audio.get("channels", 0)))
if audio["codec_name"] in core.ACODEC3_ALLOW:
audio_cmd3.extend(['-c:a:{0}'.format(used_audio), 'copy'])
else: