From f751893be23e37df26eb7b25e697105f4867dff1 Mon Sep 17 00:00:00 2001 From: wisp3rwind <17089248+wisp3rwind@users.noreply.github.com> Date: Sat, 12 Mar 2022 20:59:25 +0100 Subject: [PATCH] artresizer: add FIXME notes where we should probably add some warnings There's a lot of places where ArtResizer fails or falls back to completely silently. We should at least log this, or maybe even raise exceptions in some cases so that the caller can take a decision on how to handle the failure. --- beets/util/artresizer.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/beets/util/artresizer.py b/beets/util/artresizer.py index 77226612e..ea8b6add8 100644 --- a/beets/util/artresizer.py +++ b/beets/util/artresizer.py @@ -207,7 +207,7 @@ class IMBackend(LocalBackend): util.command_output(cmd) return path_out except subprocess.CalledProcessError: - # FIXME: add a warning + # FIXME: Should probably issue a warning? return path_in def get_format(self, filepath): @@ -219,6 +219,7 @@ class IMBackend(LocalBackend): try: return util.command_output(cmd).stdout except subprocess.CalledProcessError: + # FIXME: Should probably issue a warning? return None def convert_format(self, source, target, deinterlaced): @@ -236,6 +237,7 @@ class IMBackend(LocalBackend): ) return target except subprocess.CalledProcessError: + # FIXME: Should probably issue a warning? return source @property @@ -404,6 +406,7 @@ class PILBackend(LocalBackend): im.save(py3_path(path_out), progressive=False) return path_out except IOError: + # FIXME: Should probably issue a warning? return path_in def get_format(self, filepath): @@ -574,6 +577,9 @@ class ArtResizer(metaclass=Shareable): result_path = self.local_method.convert_format( path_in, path_new, deinterlaced ) + except Exception: + # FIXME: Should probably issue a warning? + pass finally: if result_path != path_in: os.unlink(path_in)