From 75afe05e7f1fb411bbba520050de3d5129112b02 Mon Sep 17 00:00:00 2001 From: tea Date: Thu, 26 Sep 2024 20:50:58 +0200 Subject: [PATCH] update np-subsonic script it seems to return "" when it doesn't have any data (network down) --- .config/zsh/functions/np-subsonic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/zsh/functions/np-subsonic b/.config/zsh/functions/np-subsonic index bd0fcb7..0a79a43 100755 --- a/.config/zsh/functions/np-subsonic +++ b/.config/zsh/functions/np-subsonic @@ -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