diff options
| author | Patrick Barron <barronpm@gmail.com> | 2020-05-15 12:51:18 -0400 |
|---|---|---|
| committer | Patrick Barron <barronpm@gmail.com> | 2020-05-15 12:51:18 -0400 |
| commit | a5dee3680880d525a6c507deb7dd284b08b7ebdd (patch) | |
| tree | 1e456a4a0c7657c9f7e7c490eead4c0d21b249e3 /Jellyfin.Server.Implementations/Activity/ActivityManager.cs | |
| parent | 953777f1ba4858f5186086e97910fcb88bfe3d61 (diff) | |
Apply more review suggestions
Diffstat (limited to 'Jellyfin.Server.Implementations/Activity/ActivityManager.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Activity/ActivityManager.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs index 0b398b60c..65ceee32b 100644 --- a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs +++ b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Jellyfin.Data.Entities; @@ -56,7 +55,7 @@ namespace Jellyfin.Server.Implementations.Activity { using var dbContext = _provider.CreateContext(); - var query = func(dbContext.ActivityLogs).OrderByDescending(entry => entry.DateCreated).AsQueryable(); + var query = func(dbContext.ActivityLogs.OrderByDescending(entry => entry.DateCreated)); if (startIndex.HasValue) { @@ -69,12 +68,12 @@ namespace Jellyfin.Server.Implementations.Activity } // This converts the objects from the new database model to the old for compatibility with the existing API. - var list = query.AsEnumerable().Select(ConvertToOldModel).ToList(); + var list = query.Select(ConvertToOldModel).ToList(); return new QueryResult<ActivityLogEntry> { Items = list, - TotalRecordCount = dbContext.ActivityLogs.Count() + TotalRecordCount = func(dbContext.ActivityLogs).Count() }; } |
