Commit b22efefe authored by Dylan Araps's avatar Dylan Araps Committed by GitHub

Merge pull request #571 from mstraube/song

Speed up song query for some players
parents 04acc365 10e3fcbd
...@@ -1223,9 +1223,7 @@ get_song() { ...@@ -1223,9 +1223,7 @@ get_song() {
"guayadeque"*) get_song_dbus "guayadeque" ;; "guayadeque"*) get_song_dbus "guayadeque" ;;
"cmus"*) "cmus"*)
artist="$(cmus-remote -Q | grep -F "tag artist ")" song="$(cmus-remote -Q | awk '/tag artist/ {$1=$2=""; print; print " - "} /tag title/ {$1=$2=""; print}')"
title="$(cmus-remote -Q | grep -F "tag title")"
song="${artist/tag artist} - ${title/tag title}"
;; ;;
"spotify"*) "spotify"*)
...@@ -1243,21 +1241,15 @@ get_song() { ...@@ -1243,21 +1241,15 @@ get_song() {
;; ;;
"banshee"*) "banshee"*)
artist="$(banshee --query-artist | awk -F':' '{print $2}')" song="$(banshee --query-artist --query-title | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')"
title="$(banshee --query-title | awk -F':' '{print $2}')"
song="$artist - $title"
;; ;;
"amarok"*) "amarok"*)
artist="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {print $2}')" song="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')"
title="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/title/ {print $2}')"
song="$artist - $title"
;; ;;
"pragha"*) "pragha"*)
artist="$(pragha -c | awk -F':' '/artist/ {print $2}')" song="$(pragha -c | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')"
title="$(pragha -c | awk -F':' '/title/ {print $2}')"
song="$artist - $title"
;; ;;
"exaile"*) "exaile"*)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment