aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2020-10-04 15:46:57 -0400
committerJoshua M. Boniface <joshua@boniface.me>2020-10-04 15:46:57 -0400
commit5aa519fd399d8b09a360f6448acc992225f8c219 (patch)
treeacda9df0982a410ee1a3a91f186729536b26073f
parent8dfa2015d0e804227fe9db09caf21315da7495e4 (diff)
Implement better count method
-rw-r--r--Emby.Server.Implementations/Session/SessionManager.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index 04becff49..d283ee8d8 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/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.Where(i => string.Equals(i.UserId, user.Id)).ToList().Count;
+ int sessionsCount = Sessions.Count(i => string.Equals(i.UserId, user.Id, StringComparison.OrdinalIgnoreCase));
int maxActiveSessions = user.MaxActiveSessions;
_logger.LogInformation("Current/Max sessions for user {User}: {Sessions}/{Max}", user.Username, sessionsCount, maxActiveSessions);
if (maxActiveSessions >= 1 && sessionsCount >= maxActiveSessions)