diff options
| author | felix920506 <felix920506@gmail.com> | 2023-11-29 03:41:30 -0500 |
|---|---|---|
| committer | felix920506 <felix920506@gmail.com> | 2023-11-29 03:41:30 -0500 |
| commit | a2bc5a5900132cfd949a857c4892b9fe0f904466 (patch) | |
| tree | 6c1e60ec249f4226c144b56fe205c9ae9456e880 | |
| parent | aaabc58c65c0b0d673ffd26a9b7e2b5eb604c053 (diff) | |
Make "activeWithinSeconds" independent from "controllableByUserId" in GetSessions
Fixes issue #10610
| -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); } |
