Use filename/URL if there's no title

This commit is contained in:
Midgard 2022-08-31 14:44:09 +02:00
parent 9827cdfd90
commit bb895e9c9a
Signed by: midgard
GPG key ID: 511C112F1331BBB4

10
mmmpd
View file

@ -50,9 +50,13 @@ def clear_status():
# ---------
def song_string(song_info):
artist = song_info.get("artist") or "Unknown artist"
title = song_info.get("title") or "Unknown song"
return f"{artist} {title}"
if song_info.get("title") is None:
artist = song_info.get("artist") or ""
title = song_info.get("file") or "Unknown song"
else:
artist = song_info.get("artist") or "Unknown artist"
title = song_info.get("title") or "Unknown song"
return f"{artist}{' ' if artist else ''}{title}"
def formatted_status(mpd_client):