The Free Software Media System - Server Backend & API
Use Enumerable.LeftJoin for activity log user query
Breno Alvimf0115293887b
diff --git a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs b/Jellyfin.Server.Implementations/Activity/ActivityManager.csindex ba24dc3864..f21e94a0fd 100644--- a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs+++ b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs@@ -56,11 +56,11 @@ public class ActivityManager : IActivityManagervar dbContext = await _provider.CreateDbContextAsync().ConfigureAwait(false);await using (dbContext.ConfigureAwait(false)){- // TODO switch to LeftJoin in .NET 10.- var entries = from a in dbContext.ActivityLogs- join u in dbContext.Users on a.UserId equals u.Id into ugj- from u in ugj.DefaultIfEmpty()- select new ExpandedActivityLog { ActivityLog = a, Username = u.Username };+ var entries = dbContext.ActivityLogs.LeftJoin(+ dbContext.Users,+ a => a.UserId,+ u => u.Id,+ (a, u) => new ExpandedActivityLog { ActivityLog = a, Username = u == null ? null : u.Username });if (query.HasUserId is not null){