aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2020-10-04 16:57:48 -0400
committerJoshua M. Boniface <joshua@boniface.me>2020-10-04 17:00:13 -0400
commit67e89dd5255a8ae38e0f0f489595d290e718b7a1 (patch)
tree91db5bcbc6e43b5a1035aa1d9ee926e8cc406835
parentdf177b47524c0f7c5df21f32ebeaba5576d3f8a4 (diff)
Use nicer count comparitor
-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..fa4caeb18 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 => i.UserId.Equals(user.Id));
int maxActiveSessions = user.MaxActiveSessions;
_logger.LogInformation("Current/Max sessions for user {User}: {Sessions}/{Max}", user.Username, sessionsCount, maxActiveSessions);
if (maxActiveSessions >= 1 && sessionsCount >= maxActiveSessions)