From 61a987061e9da549ccdf466a91869af0c3ab2a5f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 4 Feb 2021 14:18:51 +0100 Subject: [PATCH] Don't log missing mpd artwork inappropriately (#45908) This can get unnecessarily spammy and doesn't represent an actual actionable issue. Fixes: #45235 --- homeassistant/components/mpd/manifest.json | 2 +- homeassistant/components/mpd/media_player.py | 18 ++++++++++-------- requirements_all.txt | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/mpd/manifest.json b/homeassistant/components/mpd/manifest.json index 12ce5b61b74..a11b9fedd80 100644 --- a/homeassistant/components/mpd/manifest.json +++ b/homeassistant/components/mpd/manifest.json @@ -2,6 +2,6 @@ "domain": "mpd", "name": "Music Player Daemon (MPD)", "documentation": "https://www.home-assistant.io/integrations/mpd", - "requirements": ["python-mpd2==3.0.3"], + "requirements": ["python-mpd2==3.0.4"], "codeowners": ["@fabaff"] } diff --git a/homeassistant/components/mpd/media_player.py b/homeassistant/components/mpd/media_player.py index 6685347b3e3..371d2060680 100644 --- a/homeassistant/components/mpd/media_player.py +++ b/homeassistant/components/mpd/media_player.py @@ -281,20 +281,22 @@ class MpdDevice(MediaPlayerEntity): try: response = await self._client.readpicture(file) except mpd.CommandError as error: - _LOGGER.warning( - "Retrieving artwork through `readpicture` command failed: %s", - error, - ) + if error.errno is not mpd.FailureResponseCode.NO_EXIST: + _LOGGER.warning( + "Retrieving artwork through `readpicture` command failed: %s", + error, + ) # read artwork contained in the media directory (cover.{jpg,png,tiff,bmp}) if none is embedded if can_albumart and not response: try: response = await self._client.albumart(file) except mpd.CommandError as error: - _LOGGER.warning( - "Retrieving artwork through `albumart` command failed: %s", - error, - ) + if error.errno is not mpd.FailureResponseCode.NO_EXIST: + _LOGGER.warning( + "Retrieving artwork through `albumart` command failed: %s", + error, + ) if not response: return None, None diff --git a/requirements_all.txt b/requirements_all.txt index 37422a65972..f0758ae9646 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1795,7 +1795,7 @@ python-juicenet==1.0.1 python-miio==0.5.4 # homeassistant.components.mpd -python-mpd2==3.0.3 +python-mpd2==3.0.4 # homeassistant.components.mystrom python-mystrom==1.1.2