mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 14:08:44 -04:00
Use nicer count comparitor
This commit is contained in:
parent
df177b4752
commit
67e89dd525
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue