mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Fixed people saving
This commit is contained in:
parent
acd878e67e
commit
8165813414
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user