Don't log missing mpd artwork inappropriately (#45908)

This can get unnecessarily spammy and doesn't represent an actual
actionable issue.

Fixes: #45235
This commit is contained in:
Martin Weinelt 2021-02-04 14:18:51 +01:00 committed by GitHub
parent 134b1d3f63
commit 61a987061e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 10 deletions

View file

@ -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"]
}

View file

@ -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

View file

@ -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