mirror of
https://github.com/beetbox/beets.git
synced 2026-01-11 02:13:28 +01:00
Only try to add albumart if the MIME-type is correct, log if it's not.
This commit is contained in:
parent
0628d8df0e
commit
1859375593
1 changed files with 10 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue