diff options
| author | Cody Robibero <cody@robibe.ro> | 2022-01-20 08:46:17 -0700 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2022-01-20 08:53:06 -0700 |
| commit | a60cb280a3d31ba19ffb3a94cf83ef300a7473b7 (patch) | |
| tree | 5d8df85ae958dd4ed1c4b8c5c8f568d0c82ce405 /Jellyfin.Server.Implementations/Devices | |
| parent | cd4587b43f9831a9529ddaed50ba4b9935fa061b (diff) | |
Properly populate QueryResult
Diffstat (limited to 'Jellyfin.Server.Implementations/Devices')
| -rw-r--r-- | Jellyfin.Server.Implementations/Devices/DeviceManager.cs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs index 6c77421c7..b5fc96079 100644 --- a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs +++ b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs @@ -145,12 +145,10 @@ namespace Jellyfin.Server.Implementations.Devices devices = devices.Take(query.Limit.Value); } - return new QueryResult<Device> - { - Items = await devices.ToListAsync().ConfigureAwait(false), - StartIndex = query.Skip ?? 0, - TotalRecordCount = count - }; + return new QueryResult<Device>( + query.Skip, + count, + await devices.ToListAsync().ConfigureAwait(false)); } /// <inheritdoc /> @@ -158,12 +156,10 @@ namespace Jellyfin.Server.Implementations.Devices { var devices = await GetDevices(query).ConfigureAwait(false); - return new QueryResult<DeviceInfo> - { - Items = devices.Items.Select(device => ToDeviceInfo(device)).ToList(), - StartIndex = devices.StartIndex, - TotalRecordCount = devices.TotalRecordCount - }; + return new QueryResult<DeviceInfo>( + devices.StartIndex, + devices.TotalRecordCount, + devices.Items.Select(device => ToDeviceInfo(device)).ToList()); } /// <inheritdoc /> |
