From b53aff9b15681ddc730f11494bb8b9ba28e1c339 Mon Sep 17 00:00:00 2001 From: Aidan Epstein Date: Wed, 7 Jan 2026 09:12:55 -0800 Subject: [PATCH] Fix fetchart colors broken by 67e668d81ff03d7ce14671e68676a7ad9d0ed94a --- beetsplug/fetchart.py | 4 ++-- docs/changelog.rst | 1 + test/plugins/test_fetchart.py | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index 9f5ed69fb..f1cc85f44 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -1588,7 +1588,7 @@ class FetchArtPlugin(plugins.BeetsPlugin, RequestMixin): message = ui.colorize( "text_highlight_minor", "has album art" ) - self._log.info("{}: {}", album, message) + ui.print_(f"{album}: {message}") else: # In ordinary invocations, look for images on the # filesystem. When forcing, however, always go to the Web @@ -1601,4 +1601,4 @@ class FetchArtPlugin(plugins.BeetsPlugin, RequestMixin): message = ui.colorize("text_success", "found album art") else: message = ui.colorize("text_error", "no art found") - self._log.info("{}: {}", album, message) + ui.print_(f"{album}: {message}") diff --git a/docs/changelog.rst b/docs/changelog.rst index 13dd15737..8d3f2b079 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -37,6 +37,7 @@ New features: differences in metadata source styles. - :doc:`plugins/spotify`: Added support for multi-artist albums and tracks, saving all contributing artists to the respective fields. +- :doc:`plugins/fetchart`: Fix colorized output text. - :doc:`plugins/ftintitle`: Featured artists are now inserted before brackets containing remix/edit-related keywords (e.g., "Remix", "Live", "Edit") instead of being appended at the end. This improves formatting for titles like "Song 1 diff --git a/test/plugins/test_fetchart.py b/test/plugins/test_fetchart.py index 853820d92..96d882e9a 100644 --- a/test/plugins/test_fetchart.py +++ b/test/plugins/test_fetchart.py @@ -98,3 +98,8 @@ class FetchartCliTest(PluginTestCase): self.run_command("fetchart") self.album.load() self.check_cover_is_stored() + + def test_colorization(self): + self.config["ui"]["color"] = True + out = self.run_with_output("fetchart") + assert " - the älbum: \x1b[1;31mno art found\x1b[39;49;00m\n" == out