mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Implement better count method
This commit is contained in:
parent
8dfa2015d0
commit
5aa519fd39
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user