Only try to add albumart if the MIME-type is correct, log if it's not.

This commit is contained in:
Daniele Sluijters 2011-04-10 14:54:32 +02:00
parent 0628d8df0e
commit 1859375593

View file

@ -34,12 +34,13 @@ class EmbedAlbumartPlugin(BeetsPlugin):
if mime_img in ALLOWED_MIMES:
mime_type = 'image/%s' % mime_img
for item in album.items():
f = mediafile.MediaFile(item)
if "mp3" in item.type:
f.albumart_mime = mime_type
f.albumart_data = albumart_raw
f.save()
for item in album.items():
f = mediafile.MediaFile(item)
if "mp3" in item.type:
f.albumart_mime = mime_type
f.albumart_data = albumart_raw
f.save()
else:
log.error('Sorry, a file of type %s is not allowed as a coverart' % mime_img)