diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index d4ab714de..70477a624 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -210,8 +210,8 @@ class ArtSource(RequestMixin): def fetch_image(self, candidate, plugin): raise NotImplementedError() - def cleanup_tmp(self, candidate): - raise NotImplementedError() + def cleanup(self, candidate): + pass class LocalArtSource(ArtSource): @@ -221,10 +221,6 @@ class LocalArtSource(ArtSource): def fetch_image(self, candidate, plugin): pass - def cleanup_tmp(self, candidate): - # local art source does not create tmp files - pass - class RemoteArtSource(ArtSource): IS_LOCAL = False @@ -298,7 +294,7 @@ class RemoteArtSource(ArtSource): self._log.debug(u'error fetching art: {}', exc) return - def cleanup_tmp(self, candidate): + def cleanup(self, candidate): if candidate.path: try: util.remove(path=candidate.path) @@ -1031,8 +1027,8 @@ class FetchArtPlugin(plugins.BeetsPlugin, RequestMixin): u'using {0.LOC_STR} image {1}'.format( source, util.displayable_path(out.path))) break - # else: remove tmp images created by this invalid candidate - source.cleanup_tmp(candidate) + # Remove temporary files for invalid candidates. + source.cleanup(candidate) if out: break diff --git a/docs/changelog.rst b/docs/changelog.rst index 5d8c26bb9..c09b1b8ab 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -122,9 +122,11 @@ New features: Fixes: -* :doc:`/plugins/fetchart`: Fixed a bug that caused fetchart to not take +* :doc:`/plugins/fetchart`: Fixed a bug that caused fetchart to not take environment variables such as proxy servers into account when making requests :bug:`3450` +* :doc:`/plugins/fetchart`: Temporary files for fetched album art that fail + validation are now removed * :doc:`/plugins/inline`: In function-style field definitions that refer to flexible attributes, values could stick around from one function invocation to the next. This meant that, when displaying a list of objects, later