浏览代码

Revert "Implement better count method"

This reverts commit 5aa519fd399d8b09a360f6448acc992225f8c219.
Joshua M. Boniface 4 年之前
父节点
当前提交
df177b4752
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Emby.Server.Implementations/Session/SessionManager.cs

+ 1 - 1
Emby.Server.Implementations/Session/SessionManager.cs

@@ -1484,7 +1484,7 @@ namespace Emby.Server.Implementations.Session
                 throw new SecurityException("User is not allowed access from this device.");
             }
 
-            int sessionsCount = Sessions.Count(i => string.Equals(i.UserId, user.Id, StringComparison.OrdinalIgnoreCase));
+            int sessionsCount = Sessions.Where(i => string.Equals(i.UserId, user.Id)).ToList().Count;
             int maxActiveSessions = user.MaxActiveSessions;
             _logger.LogInformation("Current/Max sessions for user {User}: {Sessions}/{Max}", user.Username, sessionsCount, maxActiveSessions);
             if (maxActiveSessions >= 1 && sessionsCount >= maxActiveSessions)