From 3bb44ffd023d0c673f0c40a013b5092daa2f874f Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Sun, 18 Feb 2024 03:00:34 +0100
Subject: [PATCH] fix(jellyfin): Make condition work with multiple online
 devices

---
 apps/k8s01/jellyfin/jellyfin-pdb-mgr/deployment.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/k8s01/jellyfin/jellyfin-pdb-mgr/deployment.yaml b/apps/k8s01/jellyfin/jellyfin-pdb-mgr/deployment.yaml
index 28a70dc9e..42001b834 100644
--- a/apps/k8s01/jellyfin/jellyfin-pdb-mgr/deployment.yaml
+++ b/apps/k8s01/jellyfin/jellyfin-pdb-mgr/deployment.yaml
@@ -9,7 +9,7 @@
         #!/bin/sh
 
         while true; do
-            if curl --variable %JELLYFIN_KEY 'http://localhost:8096/Sessions\?ApiKey\={{JELLYFIN_KEY:url}}' | jq -e '.[].NowPlayingItem != null'; then
+            if curl --variable %JELLYFIN_KEY 'http://localhost:8096/Sessions\?ApiKey\={{JELLYFIN_KEY:url}}' | jq '.[].NowPlayingItem != null' | grep 'true'; then
                 kubectl patch --patch '{"spec": {"maxUnavailable:": 0}}' jellyfin
             else
                 kubectl patch --patch '{"spec": {"maxUnavailable:": 1}}' jellyfin
-- 
GitLab