From 91952bdeaf4f2290801eb66ce4dd966f0efbf536 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 19 Nov 2024 12:28:32 -0500 Subject: [PATCH] mpris-status: Don't fail when metadata values are None --- .config/xfce4/panel/scripts/mpris-status.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/xfce4/panel/scripts/mpris-status.py b/.config/xfce4/panel/scripts/mpris-status.py index f753604..327cf62 100755 --- a/.config/xfce4/panel/scripts/mpris-status.py +++ b/.config/xfce4/panel/scripts/mpris-status.py @@ -54,9 +54,9 @@ def format_player(player: Player, short: bool = False) -> str: "Stopped": "⏹️", }.get(player.PlaybackStatus, "❓") + " " - artist = escape(",".join(metadata.artist)) - album = escape(metadata.album) - title = escape(metadata.title) + artist = escape(",".join(metadata.artist)) if metadata.artist else "" + album = escape(metadata.album) if metadata.album else "" + title = escape(metadata.title) if metadata.title else "" if short: # TODO: could be a bit more clever here to use the whole space artist = shorten(artist, 40, placeholder="…")