song: print empty tags correctly

This commit is contained in:
Michael Straube 2019-12-29 11:00:13 +01:00
parent 5c7ad91bdf
commit 541322beea
1 changed files with 19 additions and 13 deletions

View File

@ -2601,11 +2601,9 @@ get_song() {
}
case ${player/*\/} in
"mpd"*|"mopidy"*) song="$(mpc -f '%artist%\n%album%\n%title%' current "${mpc_args[@]}")" ;;
"mocp"*) song="$(mocp -Q '%artist \n%album \n%song')" ;;
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist% \\n%album% \\n%title%')" ;;
"xmms2d"*) song="$(xmms2 current -f "\${artist}"$'\n'"\${album}"$'\n'"\${title}")" ;;
"qmmp"*) song="$(qmmp --nowplaying '%p\\n%a\\n%t')" ;;
"qmmp"*) song="$(qmmp --nowplaying '%p \n%a \n%t')" ;;
"gnome-music"*) get_song_dbus "GnomeMusic" ;;
"lollypop"*) get_song_dbus "Lollypop" ;;
"clementine"*) get_song_dbus "clementine" ;;
@ -2632,6 +2630,14 @@ get_song() {
"plasma-browser-integration"*) get_song_dbus "plasma-browser-integration" ;;
"io.elementary.music"*) get_song_dbus "Music" ;;
"mpd"* | "mopidy"*)
song="$(mpc -f '%artist% \n%album% \n%title%' current "${mpc_args[@]}")"
;;
"xmms2d"*)
song="$(xmms2 current -f "\${artist}"$' \n'"\${album}"$' \n'"\${title}")"
;;
"cmus"*)
# NOTE: cmus >= 2.8.0 supports mpris2
song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "};