Browse Source

Make "activeWithinSeconds" independent from "controllableByUserId" in GetSessions

Fixes issue #10610
felix920506 1 năm trước cách đây
mục cha
commit
a2bc5a5900
1 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 6 6
      Jellyfin.Api/Controllers/SessionController.cs

+ 6 - 6
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);
     }