mirror of
https://github.com/beetbox/beets.git
synced 2025-12-07 17:16:07 +01:00
Idiomatic configuration defaults (#1398)
Paging @jmwatte: `config.add` is the standard way to specify defaults for configuration options.
This commit is contained in:
parent
1f08470fb3
commit
ecb65a5a4a
1 changed files with 7 additions and 9 deletions
|
|
@ -93,16 +93,14 @@ class Bs1770gainBackend(Backend):
|
|||
|
||||
def __init__(self, config, log):
|
||||
super(Bs1770gainBackend, self).__init__(config, log)
|
||||
cmd = b'bs1770gain'
|
||||
try:
|
||||
self.chunk_at = config['chunk_at'].as_number()
|
||||
except:
|
||||
self.chunk_at = 5000
|
||||
try:
|
||||
self.method = b'--' + config['method'].get(str)
|
||||
except:
|
||||
self.method = b'--replaygain'
|
||||
config.add({
|
||||
'chunk_at': 5000,
|
||||
'method': 'replaygain',
|
||||
})
|
||||
self.chunk_at = config['chunk_at'].as_number()
|
||||
self.method = b'--' + bytes(config['method'].get(unicode))
|
||||
|
||||
cmd = b'bs1770gain'
|
||||
try:
|
||||
call([cmd, self.method])
|
||||
self.command = cmd
|
||||
|
|
|
|||
Loading…
Reference in a new issue