nixos-config/pkgs/hassbridge/0001-fix-xesam-artist.patch
Erwin Boskma 8ccc0ab2a9
Add hassbridge
A bridge application that exposes Home Assistant media players to MPRIS
2024-08-13 14:34:24 +02:00

23 lines
918 B
Diff

diff --git a/hassbridge/playerinterface.py b/hassbridge/playerinterface.py
index 34159c8..0c337c2 100644
--- a/hassbridge/playerinterface.py
+++ b/hassbridge/playerinterface.py
@@ -279,7 +279,6 @@ class PlayerInterface(ServiceInterface):
metadata["mpris:length"] = Variant("x", duration)
xesam_infos = {
- "media_artist": "xesam:artist",
"media_album_name": "xesam:album",
"media_title": "xesam:title",
}
@@ -288,6 +287,10 @@ class PlayerInterface(ServiceInterface):
if val is not None:
metadata[xesam_key] = Variant("s", val)
+ artist = self.data.get("media_artist")
+ if artist is not None:
+ metadata["xesam:artist"] = Variant("as", [artist])
+
entity_picture = self.data.get("entity_picture")
if entity_picture is not None:
metadata["mpris:artUrl"] = Variant(