Clean filename if falling back to file name
This commit is contained in:
parent
d4ba2a548d
commit
9b7b119001
1 changed files with 5 additions and 1 deletions
6
mmmpd
6
mmmpd
|
@ -53,7 +53,11 @@ 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"
|
||||
title = re.sub(
|
||||
r"\.[a-z0-9]+$",
|
||||
"",
|
||||
os.path.basename(song_info.get("file"))
|
||||
) or "Unknown song"
|
||||
else:
|
||||
artist = song_info.get("artist") or "Unknown artist"
|
||||
title = song_info.get("title") or "Unknown song"
|
||||
|
|
Loading…
Reference in a new issue