aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels van Velzen <nielsvanvelzen@users.noreply.github.com>2025-03-24 15:29:28 +0100
committerGitHub <noreply@github.com>2025-03-24 15:29:28 +0100
commit86801707066122f7ebc1e17d757b69ab92ab9475 (patch)
tree71450e83dc45026417468b165e064bb79f612576
parent480244e1112a96e8097c7574ef2aebb1b26fe8e4 (diff)
parentcf1f251f2a2115c84539f41603252a6733e02482 (diff)
Merge pull request #13616 from Lampan-git/fix_people_role
Include PeopleBaseItemMap in GetPeople to inlcude Role and SortOrder
-rw-r--r--Jellyfin.Server.Implementations/Item/PeopleRepository.cs9
-rw-r--r--Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs4
2 files changed, 10 insertions, 3 deletions
diff --git a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs b/Jellyfin.Server.Implementations/Item/PeopleRepository.cs
index a8dfd4cd3..1396f1c6f 100644
--- a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs
+++ b/Jellyfin.Server.Implementations/Item/PeopleRepository.cs
@@ -39,6 +39,12 @@ public class PeopleRepository(IDbContextFactory<JellyfinDbContext> dbProvider, I
dbQuery = dbQuery.Take(filter.Limit);
}
+ // Include PeopleBaseItemMap
+ if (!filter.ItemId.IsEmpty())
+ {
+ dbQuery = dbQuery.Include(p => p.BaseItems!.Where(m => m.ItemId == filter.ItemId));
+ }
+
return dbQuery.AsEnumerable().Select(Map).ToArray();
}
@@ -93,10 +99,13 @@ public class PeopleRepository(IDbContextFactory<JellyfinDbContext> dbProvider, I
private 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))
{
diff --git a/Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs b/Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs
index d2fbcbec9..9e33eb2a7 100644
--- a/Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs
+++ b/Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs
@@ -242,9 +242,7 @@ public class MigrateLibraryDb : IMigrationRoutine
{
}
- if (reader.TryGetInt32(4, out var sortOrder))
- {
- }
+ int? sortOrder = reader.IsDBNull(4) ? null : reader.GetInt32(4);
personCache.Items.Add(new PeopleBaseItemMap()
{