浏览代码

Count records before skipping

Patrick Barron 4 年之前
父节点
当前提交
2a9474f6e7
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Jellyfin.Server.Implementations/Devices/DeviceManager.cs

+ 2 - 2
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);