mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-21 12:19:27 +00:00
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:
@@ -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">
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user