aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Activity
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2020-05-15 12:51:18 -0400
committerPatrick Barron <barronpm@gmail.com>2020-05-15 12:51:18 -0400
commita5dee3680880d525a6c507deb7dd284b08b7ebdd (patch)
tree1e456a4a0c7657c9f7e7c490eead4c0d21b249e3 /Jellyfin.Server.Implementations/Activity
parent953777f1ba4858f5186086e97910fcb88bfe3d61 (diff)
Apply more review suggestions
Diffstat (limited to 'Jellyfin.Server.Implementations/Activity')
-rw-r--r--Jellyfin.Server.Implementations/Activity/ActivityManager.cs7
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()
};
}