diff options
| author | Cody Robibero <cody@robibe.ro> | 2023-11-30 15:58:56 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-30 15:58:56 -0700 |
| commit | 7ebb4d3b24aa1e23ff7c13d541fff88b9a66c2bb (patch) | |
| tree | 0992ec2c9c1efb0c4dfc9240a4b5750e4ac46ca1 | |
| parent | 818b860c21c9eb8a5bc329ef8e74b16d72efdb21 (diff) | |
| parent | a2bc5a5900132cfd949a857c4892b9fe0f904466 (diff) | |
Merge pull request #10649 from felix920506/issue-10610
Make "activeWithinSeconds" independent from "controllableByUserId" parameter
| -rw-r--r-- | Jellyfin.Api/Controllers/SessionController.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs index f0e578e7a..fdebb3d45 100644 --- a/Jellyfin.Api/Controllers/SessionController.cs +++ b/Jellyfin.Api/Controllers/SessionController.cs @@ -91,12 +91,6 @@ public class SessionController : BaseJellyfinApiController result = 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); } |
