From 1859375593f61d57ef761b151664f45f557bf5da Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Sun, 10 Apr 2011 14:54:32 +0200 Subject: [PATCH] Only try to add albumart if the MIME-type is correct, log if it's not. --- beetsplug/embedcoverart.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/beetsplug/embedcoverart.py b/beetsplug/embedcoverart.py index 75ffafba8..4a5b3a5a6 100644 --- a/beetsplug/embedcoverart.py +++ b/beetsplug/embedcoverart.py @@ -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)