fix crash when WMA is missing cover art (#75)

This commit is contained in:
Adrian Sampson 2013-01-29 21:46:58 -08:00
parent e25b2ec740
commit 10dfa780d1
2 changed files with 11 additions and 11 deletions

View file

@ -618,15 +618,15 @@ class ImageField(object):
return None
elif obj.type == 'asf':
pictures = obj.mgfile['WM/Picture']
if pictures:
data = pictures[0].value
try:
return _unpack_asf_image(data)[1]
except:
return None
else:
return None
if 'WM/Picture' in obj.mgfile:
pictures = obj.mgfile['WM/Picture']
if pictures:
data = pictures[0].value
try:
return _unpack_asf_image(data)[1]
except:
return None
return None
else:
# Here we're assuming everything but MP3, MPEG-4, and FLAC

View file

@ -198,11 +198,11 @@ READ_ONLY_CORRECT_DICTS = {
'full.wma': {
'length': 1.0,
'bitrate': 23,
'bitrate': 128000,
'format': 'Windows Media',
'samplerate': 44100,
'bitdepth': 0,
'channels': 2,
'channels': 1,
},
}