From 3252c121f2cc17c6c5671a2c75bc0f7400e70f4b Mon Sep 17 00:00:00 2001 From: tea Date: Fri, 8 Nov 2024 20:16:32 +0100 Subject: [PATCH] fix np-subsonic to only use the user's status --- .config/zsh/functions/np-subsonic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/zsh/functions/np-subsonic b/.config/zsh/functions/np-subsonic index 0a79a43..eacd926 100755 --- a/.config/zsh/functions/np-subsonic +++ b/.config/zsh/functions/np-subsonic @@ -19,7 +19,7 @@ local token=$(print -n "${password}${salt}" | md5sum | cut -d' ' -f1) local response=$(curl --silent \ "${host}/rest/getNowPlaying?v=${api_version}&c=${useragent}&u=${user}&s=${salt}&t=${token}&f=json") -local entry=$(jq '."subsonic-response".nowPlaying.entry[0]' <<<${response}) +local entry=$(jq '."subsonic-response".nowPlaying.entry[] | select(.username == "'${user}'")' <<<${response} local title=$(jq --raw-output .title <<< ${entry}) local artist=$(jq --raw-output .artist <<< ${entry})