mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-21 08:24:00 +01: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:
@@ -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