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": "⏹️",
|
"Stopped": "⏹️",
|
||||||
}.get(player.PlaybackStatus, "❓") + " "
|
}.get(player.PlaybackStatus, "❓") + " "
|
||||||
|
|
||||||
artist = escape(",".join(metadata.artist))
|
artist = escape(",".join(metadata.artist)) if metadata.artist else ""
|
||||||
album = escape(metadata.album)
|
album = escape(metadata.album) if metadata.album else ""
|
||||||
title = escape(metadata.title)
|
title = escape(metadata.title) if metadata.title else ""
|
||||||
if short:
|
if short:
|
||||||
# TODO: could be a bit more clever here to use the whole space
|
# TODO: could be a bit more clever here to use the whole space
|
||||||
artist = shorten(artist, 40, placeholder="…")
|
artist = shorten(artist, 40, placeholder="…")
|
||||||
|
Loading…
Reference in New Issue
Block a user