The Free Software Media System - Server Backend & API
Make "activeWithinSeconds" independent from "controllableByUserId" in GetSessions
felix920506a2bc5a590013
diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.csindex f0e578e7a0..fdebb3d450 100644--- a/Jellyfin.Api/Controllers/SessionController.cs+++ b/Jellyfin.Api/Controllers/SessionController.cs@@ -91,12 +91,6 @@ public class SessionController : BaseJellyfinApiControllerresult = result.Where(i => !i.UserId.Equals(default));}- if (activeWithinSeconds.HasValue && activeWithinSeconds.Value > 0)- {- var minActiveDate = DateTime.UtcNow.AddSeconds(0 - activeWithinSeconds.Value);- result = result.Where(i => i.LastActivityDate >= minActiveDate);- }-result = result.Where(i =>{if (!string.IsNullOrWhiteSpace(i.DeviceId))@@ -111,6 +105,12 @@ public class SessionController : BaseJellyfinApiController});}+ if (activeWithinSeconds.HasValue && activeWithinSeconds.Value > 0)+ {+ var minActiveDate = DateTime.UtcNow.AddSeconds(0 - activeWithinSeconds.Value);+ result = result.Where(i => i.LastActivityDate >= minActiveDate);+ }+return Ok(result);}