aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2024-11-14 10:14:41 +0000
committerJPVenson <github@jpb.email>2024-11-14 10:14:41 +0000
commitaea255f91026598c297d11f032cc483b8608616d (patch)
tree9d1ba19fb8cdb9cb19d205168d0631537ffb0399 /Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
parent432cfba2e2516709dfaea004a2d74095aac6a6f3 (diff)
Deterministic tests my ***
Diffstat (limited to 'Jellyfin.Server.Implementations/Item/BaseItemRepository.cs')
-rw-r--r--Jellyfin.Server.Implementations/Item/BaseItemRepository.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
index 14300d237..f62d6fc1a 100644
--- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
+++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
@@ -83,7 +83,7 @@ public sealed class BaseItemRepository(
context.Peoples.Where(e => e.BaseItems!.Count == 0).ExecuteDelete();
context.Chapters.Where(e => e.ItemId == id).ExecuteDelete();
context.MediaStreamInfos.Where(e => e.ItemId == id).ExecuteDelete();
- context.AncestorIds.Where(e => e.ItemId == id).ExecuteDelete();
+ context.AncestorIds.Where(e => e.ItemId == id || e.ParentItemId == id).ExecuteDelete();
context.ItemValuesMap.Where(e => e.ItemId == id).ExecuteDelete();
context.ItemValues.Where(e => e.BaseItemsMap!.Count == 0).ExecuteDelete();
context.BaseItemImageInfos.Where(e => e.ItemId == id).ExecuteDelete();
@@ -1292,7 +1292,7 @@ public sealed class BaseItemRepository(
{
if (!context.BaseItems.Any(f => f.Id == ancestorId))
{
- throw new InvalidOperationException($"Cannot link non-existent parent: {ancestorId}");
+ continue;
}
context.AncestorIds.Add(new AncestorId()