mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-01 06:16:30 +01:00
Fixed Scan saving library items
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user