The Free Software Media System - Server Backend & API
Revert "Implement better count method"
Joshua M. Bonifacedf177b47524c
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.csindex d283ee8d8b..04becff49c 100644--- a/Emby.Server.Implementations/Session/SessionManager.cs+++ b/Emby.Server.Implementations/Session/SessionManager.cs@@ -1484,7 +1484,7 @@ namespace Emby.Server.Implementations.Sessionthrow 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)