allow convert to be used without embedart enabled

This commit is contained in:
Adrian Sampson 2013-01-23 15:56:49 -08:00
parent 7e84e7da57
commit 6898d95b9e

View file

@ -26,10 +26,9 @@ from beets import config
log = logging.getLogger('beets')
def _embed(path, items):
def _embed(path, items, maxwidth=0):
"""Embed an image file, located at `path`, into each item.
"""
maxwidth = config['embedart']['maxwidth'].get(int)
if maxwidth:
path = ArtResizer.shared.resize(maxwidth, syspath(path))
@ -110,7 +109,8 @@ def embed(lib, imagepath, query):
log.info('Embedding album art into %s - %s.' % \
(album.albumartist, album.album))
_embed(imagepath, album.items())
_embed(imagepath, album.items(),
config['embedart']['maxwidth'].get(int))
# "extractart" command.
def extract(lib, outpath, query):
@ -156,4 +156,5 @@ def clear(lib, query):
@EmbedCoverArtPlugin.listen('album_imported')
def album_imported(lib, album):
if album.artpath and config['embedart']['auto']:
_embed(album.artpath, album.items())
_embed(album.artpath, album.items(),
config['embedart']['maxwidth'].get(int))