From e622e7851cf73c0bbd12856614fd6d329602c025 Mon Sep 17 00:00:00 2001 From: Sam Jongenelen Date: Thu, 4 May 2023 09:04:08 +0200 Subject: [PATCH] Sessions query param nowPlaying null/false/true now works as expected --- Jellyfin.Api/Controllers/SessionController.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs index 07bbe77ddb..a495e20243 100644 --- a/Jellyfin.Api/Controllers/SessionController.cs +++ b/Jellyfin.Api/Controllers/SessionController.cs @@ -112,9 +112,11 @@ public class SessionController : BaseJellyfinApiController }); } - if (nowPlaying.GetValueOrDefault()) + if (nowPlaying.HasValue) { - result = result.Where(i => i.NowPlayingItem != null); + result = nowPlaying.Value + ? result.Where(i => i.NowPlayingItem != null) + : result.Where(i => i.NowPlayingItem == null); } return Ok(result);