fix np-subsonic to only use the user's status

This commit is contained in:
tea 2024-11-08 20:16:32 +01:00
parent 0c7ede586f
commit 3252c121f2
No known key found for this signature in database

View File

@ -19,7 +19,7 @@ local token=$(print -n "${password}${salt}" | md5sum | cut -d' ' -f1)
local response=$(curl --silent \ local response=$(curl --silent \
"${host}/rest/getNowPlaying?v=${api_version}&c=${useragent}&u=${user}&s=${salt}&t=${token}&f=json") "${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 title=$(jq --raw-output .title <<< ${entry})
local artist=$(jq --raw-output .artist <<< ${entry}) local artist=$(jq --raw-output .artist <<< ${entry})