From 5fbca32ea44cb0c4490b95ab516c52aa097682d9 Mon Sep 17 00:00:00 2001 From: wordofglass Date: Sun, 17 Apr 2016 20:15:12 +0200 Subject: [PATCH] reuse the 'sources' names from the configuration for art_source --- beetsplug/fetchart.py | 4 ++-- docs/plugins/fetchart.rst | 17 +++++++---------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index 291181db7..db4d0034e 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -197,7 +197,7 @@ class ArtSource(RequestMixin): raise NotImplementedError() def _candidate(self, **kwargs): - return Candidate(source=self.NAME, log=self._log, **kwargs) + return Candidate(source=self, log=self._log, **kwargs) def fetch_image(self, candidate, extra): raise NotImplementedError() @@ -764,7 +764,7 @@ class FetchArtPlugin(plugins.BeetsPlugin, RequestMixin): self._log.debug( u"Storing art_source for {0.albumartist} - {0.album}", album) - album.art_source = candidate.source + album.art_source = SOURCE_NAMES[type(candidate.source)] album.store() # Synchronous; after music files are put in place. diff --git a/docs/plugins/fetchart.rst b/docs/plugins/fetchart.rst index f59761bbb..2812c7745 100644 --- a/docs/plugins/fetchart.rst +++ b/docs/plugins/fetchart.rst @@ -62,7 +62,7 @@ file. The available options are: Default: The `beets custom search engine`_, which searches the entire web. **fanarttv_key**: The personal API key for requesting art from fanart.tv. See below. -- **store_source**: If enabled, fetchart store the artwork's source in a +- **store_source**: If enabled, fetchart stores the artwork's source in a flexible tag named ``art_source``. See below for the rationale behind this. Default: ``no``. @@ -188,18 +188,15 @@ personal key will give you earlier access to new art. Storing the Artwork's Source ---------------------------- -Storing the current artwork's source gives the opportunity to selectively -search for new art. For example, if some albums have artwork placed manually in -their directories that should not be replaced by a forced album art fetch, you -could do +Storing the current artwork's source might be used to narrow down +``fetchart`` commands. For example, if some albums have artwork placed +manually in their directories that should not be replaced by a forced +album art fetch, you could do ``beet fetchart -f ^art_source:filesystem`` -The values written to ``art_source`` are: - -``'Cover Art Archive'``, ``'Amazon'``, ``'AlbumArt.org scraper'``, ``'Google Images'``, -``'fanart.tv'``, ``'iTunes Store'``, ``'Wikipedia (queried through DBpedia)'``, -``'Filesystem'`` +The values written to ``art_source`` are the same names used in the ``sources`` +configuration value. Embedding Album Art -------------------