Count records before skipping

This commit is contained in:
Patrick Barron 2021-06-19 15:24:42 -04:00
parent 6b24cc6d1f
commit 2a9474f6e7

View File

@ -130,13 +130,13 @@ namespace Jellyfin.Server.Implementations.Devices
devices = devices.Where(device => device.AccessToken == query.AccessToken);
}
var count = await devices.CountAsync().ConfigureAwait(false);
if (query.Skip.HasValue)
{
devices = devices.Skip(query.Skip.Value);
}
var count = await devices.CountAsync().ConfigureAwait(false);
if (query.Limit.HasValue)
{
devices = devices.Take(query.Limit.Value);