diff options
| author | Patrick Barron <barronpm@gmail.com> | 2020-10-05 22:51:52 -0400 |
|---|---|---|
| committer | Patrick Barron <barronpm@gmail.com> | 2020-10-05 22:51:52 -0400 |
| commit | d4a492ef93f6b663fd4a4f7710613f06863f401f (patch) | |
| tree | 9234b976f5fad5047e2ced7d86cf784f7aa4a278 /Jellyfin.Server.Implementations/Activity/ActivityManager.cs | |
| parent | 4d7e7d6331243bd339464bd6010569c6c308088b (diff) | |
Fix activity log query.
Diffstat (limited to 'Jellyfin.Server.Implementations/Activity/ActivityManager.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Activity/ActivityManager.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs index 695e2fbd8..5926abfe0 100644 --- a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs +++ b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs @@ -45,7 +45,9 @@ namespace Jellyfin.Server.Implementations.Activity { await using var dbContext = _provider.CreateContext(); - IQueryable<ActivityLog> entries = dbContext.ActivityLogs.OrderByDescending(entry => entry.DateCreated); + IQueryable<ActivityLog> entries = dbContext.ActivityLogs + .AsQueryable() + .OrderByDescending(entry => entry.DateCreated); if (query.MinDate.HasValue) { @@ -59,10 +61,11 @@ namespace Jellyfin.Server.Implementations.Activity return new QueryResult<ActivityLogEntry> { - Items = await entries.Skip(query.StartIndex ?? 0) + Items = await entries + .Skip(query.StartIndex ?? 0) .Take(query.Limit ?? 100) + .AsAsyncEnumerable() .Select(ConvertToOldModel) - .AsQueryable() .ToListAsync() .ConfigureAwait(false), TotalRecordCount = await entries.CountAsync().ConfigureAwait(false) |
