mpris-status: Don't fail when metadata values are None
This commit is contained in:
parent
babaf53c56
commit
91952bdeaf
@ -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="…")
|
||||
|
Loading…
Reference in New Issue
Block a user