Added the option to provide an extension when using 'Advanced Encoding' instead of using the extension of the format selected in 'Audio Properties'.

This commit is contained in:
jvs3
2015-10-22 22:21:36 +02:00
parent 6720575bd9
commit e7d7dc6b6b
3 changed files with 12 additions and 1 deletions

View File

@@ -1402,6 +1402,11 @@
<input type="text" name="xldprofile" value="${config['xldprofile']}" size="43">
</div>
</div>
<div class="row">
<label>Extension</label>
<input type="text" name="encoderoutputformat" value="${config['encoderoutputformat']}" size="43">
<small>If different from format selected above</small>
</div>
<div class="row">
<label>Path to Encoder</label>
<input type="text" name="encoder_path" value="${config['encoder_path']}" size="43">

View File

@@ -128,7 +128,7 @@ def encode(albumPath):
logger.warn('Cannot re-encode .ogg %s', music.decode(headphones.SYS_ENCODING, 'replace'))
else:
encode = True
elif headphones.CONFIG.ENCODEROUTPUTFORMAT == 'mp3' or headphones.CONFIG.ENCODEROUTPUTFORMAT == 'm4a':
else:
if music.decode(headphones.SYS_ENCODING, 'replace').lower().endswith('.' + headphones.CONFIG.ENCODEROUTPUTFORMAT) and (int(infoMusic.bitrate / 1000) <= headphones.CONFIG.BITRATE):
logger.info('%s has bitrate <= %skb, will not be re-encoded', music, headphones.CONFIG.BITRATE)
else:

View File

@@ -1309,6 +1309,12 @@ class WebInterface(object):
kwargs[plain_config] = kwargs[use_config]
del kwargs[use_config]
# Check if encoderoutputformat is set multiple times
if len(kwargs['encoderoutputformat'][-1]) > 1:
kwargs['encoderoutputformat'] = kwargs['encoderoutputformat'][-1]
else:
kwargs['encoderoutputformat'] = kwargs['encoderoutputformat'][0]
extra_newznabs = []
for kwarg in [x for x in kwargs if x.startswith('newznab_host')]:
newznab_host_key = kwarg