From 6898d95b9efad8b15401d19e54b9b0a2d4cbc94b Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Wed, 23 Jan 2013 15:56:49 -0800 Subject: [PATCH] allow convert to be used without embedart enabled --- beetsplug/embedart.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/beetsplug/embedart.py b/beetsplug/embedart.py index 9c7e79d4c..5fca4c367 100644 --- a/beetsplug/embedart.py +++ b/beetsplug/embedart.py @@ -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))