diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs index 74c2ac19..8ce77df5 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs @@ -241,13 +241,17 @@ public sealed class BaseItemRepository public void UpdateInheritedValues() { using var context = _dbProvider.CreateDbContext(); - using var transaction = context.Database.BeginTransaction(); + var executionStrategy = context.Database.CreateExecutionStrategy(); + executionStrategy.Execute(() => + { + using var transaction = context.Database.BeginTransaction(); - context.ItemValuesMap.Where(e => e.ItemValue.Type == ItemValueType.InheritedTags).ExecuteDelete(); - // ItemValue Inheritance is now correctly mapped via AncestorId on demand - context.SaveChanges(); + context.ItemValuesMap.Where(e => e.ItemValue.Type == ItemValueType.InheritedTags).ExecuteDelete(); + // ItemValue Inheritance is now correctly mapped via AncestorId on demand + context.SaveChanges(); - transaction.Commit(); + transaction.Commit(); + }); } ///