diff --git a/beetsplug/embedart.py b/beetsplug/embedart.py index 99be2180f..10b30af0f 100644 --- a/beetsplug/embedart.py +++ b/beetsplug/embedart.py @@ -37,6 +37,7 @@ class EmbedCoverArtPlugin(BeetsPlugin): 'auto': True, 'compare_threshold': 0, 'ifempty': False, + 'remove_art_file': False }) if self.config['maxwidth'].get(int) and not ArtResizer.shared.local: @@ -62,6 +63,7 @@ class EmbedCoverArtPlugin(BeetsPlugin): maxwidth = self.config['maxwidth'].get(int) compare_threshold = self.config['compare_threshold'].get(int) ifempty = self.config['ifempty'].get(bool) + remove_art_file = self.config['remove_art_file'].get(bool) def embed_func(lib, opts, args): if opts.file: @@ -78,6 +80,14 @@ class EmbedCoverArtPlugin(BeetsPlugin): art.embed_album(self._log, album, maxwidth, False, compare_threshold, ifempty) + if remove_art_file and album.artpath is not None: + if os.path.isfile(album.artpath): + self._log.debug(u'Removing album art file ' + u'for {0}', album) + os.remove(album.artpath) + album.artpath = None + album.store() + embed_cmd.func = embed_func # Extract command. diff --git a/docs/changelog.rst b/docs/changelog.rst index f173e7c0a..1e0e56518 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -15,6 +15,9 @@ The new features: * :doc:`/plugins/play`: A new ``raw`` configuration option lets the command work with players (such as VLC) that expect music filenames as arguments, rather than in a playlist. Thanks to :user:`nathdwek`. :bug:`1578` +* :doc:`/plugins/embedart`: A new ``remove_art_file`` option lets you clean up + if you prefer *only* embedded album art. Thanks to :user:`jackwilsdon`. + :bug:`1591` :bug:`733` Fixes: diff --git a/docs/plugins/embedart.rst b/docs/plugins/embedart.rst index f234bc057..41cfaa87c 100644 --- a/docs/plugins/embedart.rst +++ b/docs/plugins/embedart.rst @@ -58,6 +58,12 @@ file. The available options are: the aspect ratio is preserved. See also :ref:`image-resizing` for further caveats about image resizing. Default: 0 (disabled). +- **remove_art_file**: Automatically remove the album art file for the album + after it has been embedded. This option is best used alongside the + :doc:`FetchArt ` plugin to download art with the purpose of + directly embedding it into the file's metadata without an "intermediate" + album art file. + Default: ``no``. Note: ``compare_threshold`` option requires `ImageMagick`_, and ``maxwidth`` requires either `ImageMagick`_ or `PIL`_. diff --git a/docs/reference/config.rst b/docs/reference/config.rst index 64f2f446f..8494dba07 100644 --- a/docs/reference/config.rst +++ b/docs/reference/config.rst @@ -164,7 +164,10 @@ threaded ~~~~~~~~ Either ``yes`` or ``no``, indicating whether the autotagger should use -multiple threads. This makes things faster but may behave strangely. +multiple threads. This makes things substantially faster by overlapping work: +for example, it can copy files for one album in parallel with looking up data +in MusicBrainz for a different album. You may want to disable this when +debugging problems with the autotagger. Defaults to ``yes``.