diff options
Diffstat (limited to 'Jellyfin.Server.Implementations')
3 files changed, 22 insertions, 23 deletions
diff --git a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs index ba2c8b54f9..4447b212d2 100644 --- a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs +++ b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs @@ -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 /> diff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs index 6c77421c70..b5fc96079e 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 /> diff --git a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj index 86aec13999..b7dab82af2 100644 --- a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj +++ b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj @@ -12,6 +12,10 @@ <!-- Code analysers--> <ItemGroup Condition=" '$(Configuration)' == 'Debug' "> + <PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.3"> + <PrivateAssets>all</PrivateAssets> + <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> + </PackageReference> <PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" /> <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" /> <PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /> @@ -22,14 +26,14 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="System.Linq.Async" Version="5.1.0" /> - <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.1" /> - <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.1" /> - <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1"> + <PackageReference Include="System.Linq.Async" Version="6.0.1" /> + <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.2" /> + <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.2" /> + <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> - <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.1"> + <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> |
