mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-01 05:18:27 +01:00
Properly populate QueryResult
This commit is contained in:
@@ -59,17 +59,16 @@ namespace Jellyfin.Server.Implementations.Activity
|
||||
entries = entries.Where(entry => entry.UserId != Guid.Empty == query.HasUserId.Value );
|
||||
}
|
||||
|
||||
return new QueryResult<ActivityLogEntry>
|
||||
{
|
||||
Items = await entries
|
||||
return new QueryResult<ActivityLogEntry>(
|
||||
query.Skip,
|
||||
await entries.CountAsync().ConfigureAwait(false),
|
||||
await entries
|
||||
.Skip(query.Skip ?? 0)
|
||||
.Take(query.Limit ?? 100)
|
||||
.AsAsyncEnumerable()
|
||||
.Select(ConvertToOldModel)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false),
|
||||
TotalRecordCount = await entries.CountAsync().ConfigureAwait(false)
|
||||
};
|
||||
.ConfigureAwait(false));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user