Make "activeWithinSeconds" independent from "controllableByUserId" in GetSessions

Fixes issue #10610
This commit is contained in:
felix920506 2023-11-29 03:41:30 -05:00
parent aaabc58c65
commit a2bc5a5900
No known key found for this signature in database
GPG Key ID: ED6C0F3630496234
1 changed files with 6 additions and 6 deletions

View File

@ -91,12 +91,6 @@ public class SessionController : BaseJellyfinApiController
result = result.Where(i => !i.UserId.Equals(default));
}
if (activeWithinSeconds.HasValue && activeWithinSeconds.Value > 0)
{
var minActiveDate = DateTime.UtcNow.AddSeconds(0 - activeWithinSeconds.Value);
result = result.Where(i => i.LastActivityDate >= minActiveDate);
}
result = result.Where(i =>
{
if (!string.IsNullOrWhiteSpace(i.DeviceId))
@ -111,6 +105,12 @@ public class SessionController : BaseJellyfinApiController
});
}
if (activeWithinSeconds.HasValue && activeWithinSeconds.Value > 0)
{
var minActiveDate = DateTime.UtcNow.AddSeconds(0 - activeWithinSeconds.Value);
result = result.Where(i => i.LastActivityDate >= minActiveDate);
}
return Ok(result);
}