Skip to content

The Free Software Media System - Server Backend & API

Count records before skipping

Patrick Barron2a9474f6e706
diff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
index ab31276698..b87245f0b0 100644
--- a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
+++ b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
@@ -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);