changelog and style fixes for #665

This commit is contained in:
Adrian Sampson 2014-04-06 17:59:30 -07:00
parent 1d212eb126
commit dd053d7723
2 changed files with 9 additions and 5 deletions

View file

@ -47,13 +47,14 @@ def _fetch_image(url):
log.debug(u'fetchart: downloading art: {0}'.format(url)) log.debug(u'fetchart: downloading art: {0}'.format(url))
try: try:
with closing(requests_session.get(url, stream=True)) as resp: with closing(requests_session.get(url, stream=True)) as resp:
if not 'Content-Type' in resp.headers \ if 'Content-Type' not in resp.headers \
or not resp.headers['Content-Type'] in CONTENT_TYPES: or resp.headers['Content-Type'] not in CONTENT_TYPES:
log.debug(u'fetchart: not an image') log.debug(u'fetchart: not an image')
return return
# Generate a temporary file with the correct extension. # Generate a temporary file with the correct extension.
with NamedTemporaryFile(suffix=DOWNLOAD_EXTENSION, delete=False) as fh: with NamedTemporaryFile(suffix=DOWNLOAD_EXTENSION, delete=False) \
as fh:
for chunk in resp.iter_content(): for chunk in resp.iter_content():
fh.write(chunk) fh.write(chunk)
log.debug(u'fetchart: downloaded art to: {0}'.format( log.debug(u'fetchart: downloaded art to: {0}'.format(

View file

@ -4,8 +4,6 @@ Changelog
1.3.5 (in development) 1.3.5 (in development)
---------------------- ----------------------
Changelog goes here!
New stuff: New stuff:
* :doc:`/plugins/replaygain`: Added support for calcuating ReplayGain values with * :doc:`/plugins/replaygain`: Added support for calcuating ReplayGain values with
@ -13,6 +11,11 @@ New stuff:
calculation for practially all formats. The upgraded plugin is backward calculation for practially all formats. The upgraded plugin is backward
compatible configuration-wise. compatible configuration-wise.
Fixes:
* :doc:`/plugins/fetchart`: Fix a crash when the server does not specify a
content type. Thanks to Lee Reinhardt.
1.3.4 (April 5, 2014) 1.3.4 (April 5, 2014)
--------------------- ---------------------