Explorar o código

Revert "Implement better count method"

This reverts commit 5aa519fd399d8b09a360f6448acc992225f8c219.
Joshua M. Boniface %!s(int64=4) %!d(string=hai) anos
pai
achega
df177b4752
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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)