diff options
| author | JPVenson <github@jpb.email> | 2024-11-13 20:28:52 +0000 |
|---|---|---|
| committer | JPVenson <github@jpb.email> | 2024-11-13 20:28:52 +0000 |
| commit | e43e34eab89b1ef074641cee62b9640c2a2f7ff0 (patch) | |
| tree | db0f8399e47895cc8124215857374fb2c8123b37 /Jellyfin.Server.Implementations/Item/PeopleRepository.cs | |
| parent | 2060d0ca2c1eab6c1087f3edfa56e7cb92331c22 (diff) | |
Fixed Scan saving library items
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() { |
