aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-07-23 13:35:43 +0200
committerShadowghost <Ghost_of_Stone@web.de>2026-07-23 13:41:51 +0200
commitdc300fae53b6b42090341cb517238bbc76479e02 (patch)
treea7e5f9a72afd0a6fdb699f0a4da9babbf043158f /Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs
parent88216e0ec4adc388a1db795f18fa8f4591ebc099 (diff)
Allow duplicate LinkedChildren for Playlists
Diffstat (limited to 'Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs')
-rw-r--r--Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs b/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs
index 5e5ce320a5..5f1d9bf87a 100644
--- a/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs
+++ b/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs
@@ -159,12 +159,16 @@ public class LinkedChildrenService : ILinkedChildrenService
if (existingLink is null)
{
+ var nextSortOrder = (context.LinkedChildren
+ .Where(lc => lc.ParentId == parentId)
+ .Max(lc => (int?)lc.SortOrder) ?? -1) + 1;
+
context.LinkedChildren.Add(new Jellyfin.Database.Implementations.Entities.LinkedChildEntity
{
ParentId = parentId,
ChildId = childId,
ChildType = dbChildType,
- SortOrder = null
+ SortOrder = nextSortOrder
});
}
else