From b5cb4e4cc4d4f3c9dc6445d04093da981f8ce666 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 29 Aug 2015 12:41:54 -0700 Subject: [PATCH] Slightly more efficient image streaming --- beetsplug/fetchart.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index b1f3fca74..c43a09792 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -485,7 +485,7 @@ class FetchArtPlugin(plugins.BeetsPlugin, RequestMixin): if 'Content-Type' not in resp.headers \ or resp.headers['Content-Type'] not in CONTENT_TYPES: self._log.debug( - 'not an image: {}', + 'not a supported image: {}', resp.headers.get('Content-Type') or 'no content type', ) return None @@ -493,7 +493,7 @@ class FetchArtPlugin(plugins.BeetsPlugin, RequestMixin): # Generate a temporary file with the correct extension. with NamedTemporaryFile(suffix=DOWNLOAD_EXTENSION, delete=False) as fh: - for chunk in resp.iter_content(): + for chunk in resp.iter_content(chunk_size=1024): fh.write(chunk) self._log.debug(u'downloaded art to: {0}', util.displayable_path(fh.name))