Added 'quiet' operation mode, prevents start/finish announcements for each file.

This commit is contained in:
Rowan Lewis 2013-09-14 10:18:36 +10:00
parent 52d86f0e6a
commit 80d060db07
2 changed files with 10 additions and 4 deletions

View file

@ -63,11 +63,13 @@ def get_file_extension():
def encode(source, dest):
log.info(u'Started encoding {0}'.format(util.displayable_path(source)))
command = get_command()
quiet = config['convert']['quiet'].get()
opts = []
if not quiet:
log.info(u'Started encoding {0}'.format(util.displayable_path(source)))
for arg in command:
arg = arg.encode('utf-8')
opts.append(Template(arg).substitute({
@ -86,7 +88,8 @@ def encode(source, dest):
util.prune_dirs(os.path.dirname(dest))
return
log.info(u'Finished encoding {0}'.format(util.displayable_path(source)))
if not quiet:
log.info(u'Finished encoding {0}'.format(util.displayable_path(source)))
def validate_config():
@ -269,8 +272,9 @@ class ConvertPlugin(BeetsPlugin):
},
},
u'max_bitrate': 500,
u'embed': True,
u'auto': False,
u'quiet': False,
u'embed': True,
u'paths': {},
})
validate_config()

View file

@ -61,6 +61,8 @@ The plugin offers several configuration options, all of which live under the
automatically during the ``import`` command. With this option enabled, the
importer will transcode all non-MP3 files over the maximum bitrate before
adding them to your library.
* ``quiet`` mode prevents the plugin from announcing every file it processes.
Default: false.
* ``paths`` lets you specify the directory structure and naming scheme for the
converted files. Use the same format as the top-level ``paths`` section (see
:ref:`path-format-config`). By default, the plugin reuses your top-level