diff options
Diffstat (limited to 'Jellyfin.Server.Implementations/Item/PeopleRepository.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Item/PeopleRepository.cs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs b/Jellyfin.Server.Implementations/Item/PeopleRepository.cs index e22fd0806..0812955a8 100644 --- a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs +++ b/Jellyfin.Server.Implementations/Item/PeopleRepository.cs @@ -61,7 +61,7 @@ public class PeopleRepository(IDbContextFactory<JellyfinDbContext> dbProvider, I using var transaction = context.Database.BeginTransaction(); context.PeopleBaseItemMap.Where(e => e.ItemId == itemId).ExecuteDelete(); - foreach (var item in people) + foreach (var item in people.DistinctBy(e => e.Id)) // yes for __SOME__ reason there can be duplicates. { var personEntity = Map(item); var existingEntity = context.Peoples.FirstOrDefault(e => e.Id == personEntity.Id); @@ -70,10 +70,6 @@ public class PeopleRepository(IDbContextFactory<JellyfinDbContext> dbProvider, I context.Peoples.Add(personEntity); existingEntity = personEntity; } - else - { - context.Peoples.Attach(personEntity).State = EntityState.Modified; - } context.PeopleBaseItemMap.Add(new PeopleBaseItemMap() { |
