Add methods for calling MPD's albumart command

This commit is contained in:
Danielle McLean 2024-05-17 10:18:18 +10:00
parent 8ad255856e
commit 569372d4e2
Signed by: 00dani
GPG key ID: 6854781A0488421C
2 changed files with 8 additions and 0 deletions

View file

@ -95,6 +95,13 @@ class MpdStateListener(Player):
print(song)
listener.update(song)
async def albumart(self, file: str) -> bytes | None:
try:
albumart = await self.client.albumart(file)
return albumart.get("binary")
except CommandError:
return None
async def readpicture(self, file: str) -> bytes | None:
try:
readpic = await self.client.readpicture(file)