The Free Software Media System - Server Backend & API
Move mapping assignment to Map
Lampan-git7abb94d8a200
diff --git a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs b/Jellyfin.Server.Implementations/Item/PeopleRepository.csindex 28909cea78..1396f1c6f8 100644--- a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs+++ b/Jellyfin.Server.Implementations/Item/PeopleRepository.cs@@ -43,18 +43,6 @@ public class PeopleRepository(IDbContextFactory<JellyfinDbContext> dbProvider, Iif (!filter.ItemId.IsEmpty()){dbQuery = dbQuery.Include(p => p.BaseItems!.Where(m => m.ItemId == filter.ItemId));-- return dbQuery- .AsEnumerable()- .Select(p =>- {- var personInfo = Map(p);- var mapping = p.BaseItems?.FirstOrDefault();- personInfo.Role = mapping?.Role;- personInfo.SortOrder = mapping?.SortOrder;- return personInfo;- })- .ToArray();}return dbQuery.AsEnumerable().Select(Map).ToArray();@@ -111,10 +99,13 @@ public class PeopleRepository(IDbContextFactory<JellyfinDbContext> dbProvider, Iprivate PersonInfo Map(People people){+ var mapping = people.BaseItems?.FirstOrDefault();var personInfo = new PersonInfo(){Id = people.Id,Name = people.Name,+ Role = mapping?.Role,+ SortOrder = mapping?.SortOrder};if (Enum.TryParse<PersonKind>(people.PersonType, out var kind)){