Use filename/URL if there's no title
This commit is contained in:
parent
9827cdfd90
commit
bb895e9c9a
1 changed files with 7 additions and 3 deletions
6
mmmpd
6
mmmpd
|
@ -50,9 +50,13 @@ def clear_status():
|
|||
# ---------
|
||||
|
||||
def song_string(song_info):
|
||||
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} – {title}"
|
||||
return f"{artist}{' – ' if artist else ''}{title}"
|
||||
|
||||
|
||||
def formatted_status(mpd_client):
|
||||
|
|
Loading…
Reference in a new issue