From 73a1b63f7d4c5b708daedd05c5d068890c7bfd1a Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Fri, 25 Apr 2014 12:33:09 +0200 Subject: [PATCH] Catch and log file errors when embedding images Fixes #723. --- beetsplug/embedart.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/beetsplug/embedart.py b/beetsplug/embedart.py index 085e63e16..317a5f800 100644 --- a/beetsplug/embedart.py +++ b/beetsplug/embedart.py @@ -47,13 +47,14 @@ def _embed(path, items, maxwidth=0): for item in items: try: f = mediafile.MediaFile(syspath(item.path)) - except (mediafile.UnreadableFileError, IOError) as exc: - log.warn('Could not embed art in {0}: {1}'.format( + f.images = [image] + f.save(config['id3v23'].get(bool)) + except (OSError, IOError, mediafile.UnreadableFileError, + mediafile.MutagenError) as exc: + log.error('Could not embed art in {0}: {1}'.format( displayable_path(item.path), exc )) continue - f.images = [image] - f.save(config['id3v23'].get(bool)) class EmbedCoverArtPlugin(BeetsPlugin):