update np-subsonic script

it seems to return "" when it doesn't have any data (network down)
This commit is contained in:
tea 2024-09-26 20:50:58 +02:00
parent 7e310649b7
commit 75afe05e7f
No known key found for this signature in database

View File

@ -23,7 +23,8 @@ local entry=$(jq '."subsonic-response".nowPlaying.entry[0]' <<<${response})
local title=$(jq --raw-output .title <<< ${entry})
local artist=$(jq --raw-output .artist <<< ${entry})
if [[ "${title}" != "null" && "${artist}" != "null" ]]; then
if [[ "${title}" != "" && "${artist}" != "" ]] \
&& [[ "${title}" != "null" && "${artist}" != "null" ]]; then
print ${title} ${artist}
else
return 1