From 433d6b7485e2c7ba7ed68b9e8c916de314965538 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Wed, 21 Jan 2015 09:07:59 -0800 Subject: [PATCH] embedart: Error on non-existent -f file Fixes #1252. --- beetsplug/embedart.py | 4 ++++ docs/changelog.rst | 2 ++ 2 files changed, 6 insertions(+) diff --git a/beetsplug/embedart.py b/beetsplug/embedart.py index b82a714e8..9ff4bf165 100644 --- a/beetsplug/embedart.py +++ b/beetsplug/embedart.py @@ -68,6 +68,10 @@ class EmbedCoverArtPlugin(BeetsPlugin): def embed_func(lib, opts, args): if opts.file: imagepath = normpath(opts.file) + if not os.path.isfile(syspath(imagepath)): + raise ui.UserError(u'image file {0} not found'.format( + displayable_path(imagepath) + )) for item in lib.items(decargs(args)): self.embed_item(item, imagepath, maxwidth, None, compare_threshold, ifempty) diff --git a/docs/changelog.rst b/docs/changelog.rst index 56c64dacb..1b85248f3 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -44,6 +44,8 @@ Fixes: * :doc:`/plugins/embedart`: Handle errors in ImageMagick's output. :bug:`1241` * :doc:`/plugins/keyfinder`: Parse the underlying tool's output more robustly. :bug:`1248` +* :doc:`/plugins/embedart`: We now show a comprehensible error message when + ``beet embedart -f FILE`` is given a non-existent path. :bug:`1252` For developers: