aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2024-11-14 09:55:32 +0000
committerJPVenson <github@jpb.email>2024-11-14 09:55:32 +0000
commit432cfba2e2516709dfaea004a2d74095aac6a6f3 (patch)
tree8a4fcff124ec39b1a07f899364a093d33c203cc6 /Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
parentc5488f8eadd89bc350e312e13898d2d046a29f08 (diff)
Reverted Test code
Diffstat (limited to 'Jellyfin.Server.Implementations/Item/BaseItemRepository.cs')
-rw-r--r--Jellyfin.Server.Implementations/Item/BaseItemRepository.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
index f1afd3543..14300d237 100644
--- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
+++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
@@ -1290,6 +1290,11 @@ public sealed class BaseItemRepository(
{
foreach (var ancestorId in item.AncestorIds)
{
+ if (!context.BaseItems.Any(f => f.Id == ancestorId))
+ {
+ throw new InvalidOperationException($"Cannot link non-existent parent: {ancestorId}");
+ }
+
context.AncestorIds.Add(new AncestorId()
{
ParentItemId = ancestorId,