From fc6664455acbf87cf4aad4409b6795678edc4929 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 6 Nov 2014 10:37:58 -0800 Subject: [PATCH] fetchart: Move iTunes priority I like the CAA as a first-priority search because the images are generally high-quality and there's no metadata ambiguity (we always find the right release if it's in the catalog). --- beetsplug/fetchart.py | 12 ++++++------ docs/plugins/fetchart.rst | 25 +++++++++++++++---------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index d1f20d8bb..aa752274f 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -31,9 +31,9 @@ from beets import config try: import itunes - itunes_available = True + HAVE_ITUNES = True except ImportError: - itunes_available = False + HAVE_ITUNES = False IMAGE_EXTENSIONS = ['png', 'jpg', 'jpeg'] CONTENT_TYPES = ('image/jpeg',) @@ -227,16 +227,16 @@ def _source_urls(album): through this sequence early to avoid the cost of scraping when not necessary. """ - # iTunes Store. - if itunes_available: - yield itunes_art(album) - # Cover Art Archive. if album.mb_albumid: yield caa_art(album.mb_albumid) if album.mb_releasegroupid: yield caa_group_art(album.mb_releasegroupid) + # iTunes Store. + if HAVE_ITUNES: + yield itunes_art(album) + # Amazon and AlbumArt.org. if album.asin: for url in art_for_asin(album.asin): diff --git a/docs/plugins/fetchart.rst b/docs/plugins/fetchart.rst index cec17f1bf..c0619955e 100644 --- a/docs/plugins/fetchart.rst +++ b/docs/plugins/fetchart.rst @@ -91,16 +91,8 @@ Album Art Sources ----------------- Currently, this plugin searches for art in the local filesystem as well as on -the iTunes Store, the Cover Art Archive, Amazon, and AlbumArt.org (in that -order). - -To use the iTunes Store as an art source, you must install the `python-itunes`_ -library. You can do this using `pip`_, like so:: - - $ pip install python-itunes - -.. _python-itunes: https://github.com/ocelma/python-itunes -.. _pip: http://pip.openplans.org/ +the Cover Art Archive, the iTunes Store (optionally), Amazon, AlbumArt.org, +and Google Image Search (optionally), in that order. When looking for local album art, beets checks for image files located in the same folder as the music files you're importing. Beets prefers to use an image @@ -112,6 +104,19 @@ When you choose to apply changes during an import, beets will search for art as described above. For "as-is" imports (and non-autotagged imports using the ``-A`` flag), beets only looks for art on the local filesystem. +iTunes Store +'''''''''''' + +To use the iTunes Store as an art source, install the `python-itunes`_ +library. You can do this using `pip`_, like so:: + + $ pip install python-itunes + +Once the library is installed, the plugin will use it to search automatically. + +.. _python-itunes: https://github.com/ocelma/python-itunes +.. _pip: http://pip.openplans.org/ + Google Image Search '''''''''''''''''''