mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
Fixed people saving
This commit is contained in:
@@ -83,7 +83,18 @@ public class PeopleRepository(IDbContextFactory<JellyfinDbContext> dbProvider, I
|
||||
});
|
||||
}
|
||||
|
||||
context.Peoples.AddRange(people.Select(Map));
|
||||
foreach (var person in people.Select(Map))
|
||||
{
|
||||
if (context.Peoples.Any(f => f.Id == person.Id))
|
||||
{
|
||||
context.Peoples.Attach(person).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Peoples.Add(person);
|
||||
}
|
||||
}
|
||||
|
||||
context.SaveChanges();
|
||||
transaction.Commit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user