From 06b3ee179cd6492ec71a8706ceb6ac1ff5f3c253 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 27 Jan 2014 22:38:23 -0800 Subject: [PATCH 1/2] comments, naming, and docs for part of #509 --- beetsplug/fetchart.py | 8 ++++++-- docs/changelog.rst | 3 +++ docs/plugins/fetchart.rst | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index d9e372f53..00cecfa03 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -212,15 +212,19 @@ def batch_fetch_art(lib, albums, force, maxwidth=None): if album.artpath and not force: message = 'has album art' else: - lookuppath = None if force else [album.path] - path = art_for_album(album, lookuppath, maxwidth) + # In ordinary invocations, look for images on the + # filesystem. When forcing, however, always go to the Web + # sources. + local_paths = None if force else [album.path] + path = art_for_album(album, local_paths, maxwidth) if path: album.set_art(path, False) album.store() message = 'found album art' else: message = 'no art found' + log.info(u'{0} - {1}: {2}'.format(album.albumartist, album.album, message)) diff --git a/docs/changelog.rst b/docs/changelog.rst index 7240ba6ff..4d641c654 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -39,6 +39,9 @@ Other little fixes: * Fix a potential crash when using image resizing with the :doc:`/plugins/fetchart` or :doc:`/plugins/embedart` without ImageMagick installed. +* :doc:`/plugins/fetchart`: The ``beet fetchart`` command can now associate + local images with albums (unless ``--force`` is provided). Thanks to + brilnius. 1.3.2 (December 22, 2013) diff --git a/docs/plugins/fetchart.rst b/docs/plugins/fetchart.rst index 8a584a4ab..1682ae840 100644 --- a/docs/plugins/fetchart.rst +++ b/docs/plugins/fetchart.rst @@ -32,8 +32,8 @@ been imported:: By default, the command will only look for album art when the album doesn't already have it; the ``-f`` or ``--force`` switch makes it search for art -regardless. If you specify a query, only matching albums will be processed; -otherwise, the command processes every album in your library. +in Web databases regardless. If you specify a query, only matching albums will +be processed; otherwise, the command processes every album in your library. .. _image-resizing: From 620f0f8727a4ff53345bd6346af3fd760c3ef452 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 27 Jan 2014 22:51:58 -0800 Subject: [PATCH 2/2] fetchart colors (#508): simplify, new colors Also a changelog entry. --- beetsplug/fetchart.py | 8 ++------ docs/changelog.rst | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index 31cd7f45d..f1f20545b 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -221,13 +221,9 @@ def batch_fetch_art(lib, albums, force, maxwidth=None): if path: album.set_art(path, False) album.store() - message = 'found album art' - if config['color']: - message = ui.colorize('red', message) + message = ui.colorize('green', 'found album art') else: - message = 'no art found' - if config['color']: - message = ui.colorize('turquoise', message) + message = ui.colorize('red', 'no art found') log.info(u'{0} - {1}: {2}'.format(album.albumartist, album.album, message)) diff --git a/docs/changelog.rst b/docs/changelog.rst index 4d641c654..72a743fcf 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -42,6 +42,8 @@ Other little fixes: * :doc:`/plugins/fetchart`: The ``beet fetchart`` command can now associate local images with albums (unless ``--force`` is provided). Thanks to brilnius. +* :doc:`/plugins/fetchart`: Command output is now colorized. Thanks again to + brilnius. 1.3.2 (December 22, 2013)